Skip to content

Commit

Permalink
Merge pull request #72 from ZeroGachis/fixdesign
Browse files Browse the repository at this point in the history
Fixdesign
  • Loading branch information
Mibou authored Aug 29, 2023
2 parents 36fa9cd + 09d7641 commit 88ed496
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 45 deletions.
33 changes: 1 addition & 32 deletions example/src/CardShadow/CardShadowPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,35 +16,8 @@ export const CardShadowPage = () => {
const theme = useTheme();
const customCardStyle: ViewStyle = {
marginTop: theme.sw.spacing.xxl,
backgroundColor: theme.sw.colors.neutral[50],
borderColor: theme.sw.colors.neutral[900],
borderWidth: 1,
borderRadius: 8,
width: '100%',
elevation: val,
};
const bigShadowTransparency = '1F';
const smallShadowTransparency = '33';

const bigShadowStyle: ViewStyle = {
shadowColor: theme.sw.colors.neutral[500] + bigShadowTransparency,
shadowOffset: {
width: valX,
height: valY,
},
shadowOpacity: 0.5,
shadowRadius: 10,
elevation: val,
};
const smallShadowStyle: ViewStyle = {
shadowColor: theme.sw.colors.neutral[500] + smallShadowTransparency,
shadowOffset: {
width: 0,
height: 0,
},
shadowOpacity: 0.2,
shadowRadius: 2,
};
const style = StyleSheet.create({
container: {
paddingTop: theme.sw.spacing.m,
Expand Down Expand Up @@ -106,11 +79,7 @@ export const CardShadowPage = () => {
</View>
</View>
<View>
<CustomCard
style={customCardStyle}
bigShadowStyle={bigShadowStyle}
smallShadowStyle={smallShadowStyle}
>
<CustomCard style={customCardStyle}>
<View style={style.textContent}>
<Headline size="h3" style={style.title}>
Some very interesting title
Expand Down
18 changes: 7 additions & 11 deletions src/components/card/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,39 +13,35 @@ interface Props {
export const Card = ({ children, style, bigShadowStyle, smallShadowStyle }: Props) => {
const theme = useTheme();

const bigShadowTransparency = '1F';
const smallShadowTransparency = '33';

const styles = StyleSheet.create({
container: {
backgroundColor: theme.sw.colors.neutral[50],
borderColor: theme.sw.colors.neutral[50],
borderWidth: 0,
width: '100%',
alignItems: 'center',
borderRadius: 20,
padding: theme.sw.spacing.m,
elevation: 1,
borderRadius: 20,
...style,
},
bigShadow: {
shadowColor: theme.sw.colors.neutral[500] + bigShadowTransparency,
shadowColor: theme.sw.colors.neutral[500],
shadowOffset: {
width: 0,
height: 12,
},
shadowOpacity: 0.12,
shadowRadius: 24,
elevation: 200,
...bigShadowStyle,
},
smallShadow: {
shadowColor: theme.sw.colors.neutral[500] + smallShadowTransparency,
shadowColor: theme.sw.colors.neutral[500],
shadowOffset: {
width: 0,
height: 0,
height: 2,
},
shadowOpacity: 0.2,
shadowOpacity: 0.01,
shadowRadius: 2,
elevation: 200,
...smallShadowStyle,
},
});
Expand Down
2 changes: 1 addition & 1 deletion src/components/numberField/NumberField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export const NumberField = React.forwardRef<TextInput, NumberFieldProps>(
if (parsedValue !== undefined) {
setError(
(minValue !== undefined && parsedValue < minValue) ||
(maxValue !== undefined && parsedValue > maxValue),
(maxValue !== undefined && parsedValue >= maxValue),
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/numberSelector/NumberSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const NumberSelector = ({
...style,
},
inputContainer: {
marginHorizontal: 5,
marginHorizontal: 8,
flex: 0,
},
});
Expand Down
2 changes: 2 additions & 0 deletions src/styles/themes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ const theme = {
48: '7A',
32: '52',
24: '3D',
20: '33',
16: '29',
12: '1F',
8: '14',
},
iconbuttonsize: {
Expand Down

0 comments on commit 88ed496

Please sign in to comment.