Skip to content

Commit

Permalink
feat: update toast colors
Browse files Browse the repository at this point in the history
  • Loading branch information
minheq committed Nov 27, 2019
1 parent cfd2767 commit 2509dab
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 11 deletions.
11 changes: 11 additions & 0 deletions src/Alert.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { storiesOf } from '@storybook/react';
import React from 'react';
import { Box, Alert, Spacing } from 'paramount-ui';

storiesOf('Alert', module).add('Intents', () => (
<Box>
<Alert intent="danger" description="primary" />
<Spacing />
<Alert intent="success" description="loading" />
</Box>
));
78 changes: 68 additions & 10 deletions src/AppProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,78 @@ export const AppProvider = (props: AppProviderProps): JSX.Element => {
text: 'proxima-nova, Arial, Helvetica, sans-serif',
},
overrides: {
Alert: {
Root: {
style: ({ intent }): ViewStyle => {
if (intent === 'danger') {
return {
backgroundColor: '#fffcfc',
borderWidth: 1,
borderLeftWidth: 1,
borderColor: '#d53939',
};
}

if (intent === 'success') {
return {
backgroundColor: '#f9fffe',
borderWidth: 1,
borderLeftWidth: 1,
borderColor: '#67c5bb',
};
}

return {};
},
},
Description: {
props: ({ intent }) => {
if (intent === 'danger') {
return {
align: 'center',
color: '#d53939',
};
}

if (intent === 'success') {
return {
align: 'center',
color: '#67c5bb',
};
}

return { align: 'center' };
},
},
},
Button: {
Touchable: {
style: ({ appearance }): ViewStyle => ({
backgroundColor:
appearance === 'primary' ? '#eb7209' : 'transparent',
borderWidth: appearance === 'outline' ? 1 : 0,
borderColor: '#eb7209',
}),
style: ({ appearance, isLoading }): ViewStyle => {
const backgroundColor = isLoading
? '#fffcf5'
: appearance === 'primary'
? '#eb7209'
: 'transparent';

return {
backgroundColor,
borderWidth: appearance === 'outline' ? 1 : 0,
borderColor: '#eb7209',
};
},
},
Title: {
style: ({ appearance }: any): TextStyle => ({
fontSize: 18,
color: appearance === 'primary' ? '#ffffff' : '#eb7209',
}),
style: ({ appearance }: any): TextStyle => {
return {
fontSize: 18,
color: appearance === 'primary' ? '#ffffff' : '#eb7209',
};
},
},
Loading: {
props: {
appearance: 'primary',
},
},
},
},
Expand Down
1 change: 1 addition & 0 deletions src/Button.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Box, Button } from 'paramount-ui';
storiesOf('Button', module).add('Appearances', () => (
<Box>
<Button appearance="primary" title="primary" />
<Button appearance="primary" title="loading" isLoading />
<Button appearance="minimal" title="minimal" />
<Button appearance="outline" title="outline" />
</Box>
Expand Down
2 changes: 1 addition & 1 deletion src/NavigationBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const DesktopNavigationBar = (props: NavigationBarProps): JSX.Element => {
);
};

const MobileNavigationMenuLink = (props: LinkProps) => {
const MobileNavigationMenuLink = (props: LinkProps): JSX.Element => {
const { children, to, onClick, isExternal } = props;

return (
Expand Down

0 comments on commit 2509dab

Please sign in to comment.