Skip to content

Commit

Permalink
refactor: remove elevation prop from appbar, move back screenshots
Browse files Browse the repository at this point in the history
  • Loading branch information
lukewalczak committed Mar 27, 2022
1 parent 6026129 commit 21e652f
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/components/Appbar/Appbar.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
import * as React from 'react';
import {
View,
ViewStyle,
Platform,
StyleSheet,
StyleProp,
Animated,
} from 'react-native';
import { View, ViewStyle, Platform, StyleSheet, StyleProp } from 'react-native';
import color from 'color';

import AppbarContent from './AppbarContent';
Expand Down Expand Up @@ -52,7 +45,6 @@ type Props = Partial<React.ComponentPropsWithRef<typeof View>> & {
*/
theme: Theme;
style?: StyleProp<ViewStyle>;
elevation?: 0 | 1 | 2 | 3 | 4 | 5 | Animated.Value;
};

/**
Expand All @@ -63,6 +55,10 @@ type Props = Partial<React.ComponentPropsWithRef<typeof View>> & {
* By default Appbar uses primary color as a background, in dark theme with `adaptive` mode it will use surface colour instead.
* See [Dark Theme](https://callstack.github.io/react-native-paper/theming.html#dark-theme) for more informations
*
* <div class="screenshots">
* <img class="medium" src="screenshots/appbar.png" />
* </div>
*
* ## Usage
* ```js
* import * as React from 'react';
Expand Down Expand Up @@ -108,7 +104,7 @@ const Appbar = ({
const { isV3 } = theme;
const {
backgroundColor: customBackground,
elevation = rest.elevation || isV3 ? (elevated ? 2 : 0) : 4,
elevation = isV3 ? (elevated ? 2 : 0) : 4,
...restStyle
}: ViewStyle = StyleSheet.flatten(style) || {};

Expand Down
13 changes: 13 additions & 0 deletions src/components/Appbar/AppbarAction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,19 @@ type Props = React.ComponentPropsWithoutRef<typeof IconButton> & {

/**
* A component used to display an action item in the appbar.
* <div class="screenshots">
* <figure>
* <img class="medium" src="screenshots/appbar-action-android.png" />
* <figcaption>Android</figcaption>
* </figure>
* </div>
*
* <div class="screenshots">
* <figure>
* <img class="medium" src="screenshots/appbar-action-ios.png" />
* <figcaption>iOS</figcaption>
* </figure>
* </div>
*
* ## Usage
* ```js
Expand Down
14 changes: 14 additions & 0 deletions src/components/Appbar/AppbarBackAction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,20 @@ type Props = $Omit<
/**
* A component used to display a back button in the appbar.
*
* <div class="screenshots">
* <figure>
* <img class="medium" src="screenshots/appbar-backaction-android.png" />
* <figcaption>Android</figcaption>
* </figure>
* </div>
*
* <div class="screenshots">
* <figure>
* <img class="medium" src="screenshots/appbar-backaction-ios.png" />
* <figcaption>iOS</figcaption>
* </figure>
* </div>
*
* ## Usage
* ```js
* import * as React from 'react';
Expand Down
6 changes: 6 additions & 0 deletions src/components/Appbar/AppbarContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ type Props = $RemoveChildren<typeof View> & {
/**
* A component used to display a title and optional subtitle in an appbar.
*
* <div class="screenshots">
* <figure>
* <img class="medium" src="screenshots/appbar-content.png" />
* </figure>
* </div>
*
* ## Usage
* ```js
* import * as React from 'react';
Expand Down

0 comments on commit 21e652f

Please sign in to comment.