Skip to content

Commit

Permalink
fix: correct icon button surface (#3199)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukewalczak authored Jun 10, 2022
1 parent aa533ea commit 95ff55b
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 212 deletions.
1 change: 1 addition & 0 deletions src/components/IconButton/IconButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ const styles = StyleSheet.create({
container: {
overflow: 'hidden',
margin: 6,
elevation: 0,
},
touchable: {
flexGrow: 1,
Expand Down
7 changes: 5 additions & 2 deletions src/components/ToggleButton/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import color from 'color';
import { tokens } from '../../../src/styles/themes/v3/tokens';
import { tokens } from '../../styles/themes/v3/tokens';
import type { Theme } from '../../types';

export const getToggleButtonColor = ({
Expand All @@ -16,7 +16,10 @@ export const getToggleButtonColor = ({
.rgb()
.string();
}
return theme.dark ? 'rgba(255, 255, 255, .12)' : 'rgba(0, 0, 0, .08)';
if (theme.dark) {
return 'rgba(255, 255, 255, .12)';
}
return 'rgba(0, 0, 0, .08)';
}
return 'transparent';
};
32 changes: 4 additions & 28 deletions src/components/__tests__/Appbar/__snapshots__/Appbar.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,10 @@ exports[`Appbar does not pass any additional props to Searchbar 1`] = `
"borderColor": undefined,
"borderRadius": 18,
"borderWidth": 0,
"elevation": 0,
"height": 36,
"margin": 6,
"overflow": "hidden",
"shadowColor": "#000000",
"shadowOffset": Object {
"height": 3,
"width": 0,
},
"shadowOpacity": 0.24,
"shadowRadius": 4,
"width": 36,
}
}
Expand Down Expand Up @@ -154,17 +148,11 @@ exports[`Appbar does not pass any additional props to Searchbar 1`] = `
"borderColor": undefined,
"borderRadius": 18,
"borderWidth": 0,
"elevation": 0,
"height": 36,
"margin": 6,
"opacity": 0.32,
"overflow": "hidden",
"shadowColor": "#000000",
"shadowOffset": Object {
"height": 3,
"width": 0,
},
"shadowOpacity": 0.24,
"shadowRadius": 4,
"width": 36,
}
}
Expand Down Expand Up @@ -259,16 +247,10 @@ exports[`Appbar passes additional props to AppbarBackAction, AppbarContent and A
"borderColor": undefined,
"borderRadius": 18,
"borderWidth": 0,
"elevation": 0,
"height": 36,
"margin": 6,
"overflow": "hidden",
"shadowColor": "#000000",
"shadowOffset": Object {
"height": 3,
"width": 0,
},
"shadowOpacity": 0.24,
"shadowRadius": 4,
"width": 36,
}
}
Expand Down Expand Up @@ -453,16 +435,10 @@ exports[`Appbar passes additional props to AppbarBackAction, AppbarContent and A
"borderColor": undefined,
"borderRadius": 18,
"borderWidth": 0,
"elevation": 0,
"height": 36,
"margin": 6,
"overflow": "hidden",
"shadowColor": "#000000",
"shadowOffset": Object {
"height": 3,
"width": 0,
},
"shadowOpacity": 0.24,
"shadowRadius": 4,
"width": 36,
}
}
Expand Down
96 changes: 12 additions & 84 deletions src/components/__tests__/__snapshots__/DataTable.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -236,16 +236,10 @@ exports[`renders data table pagination 1`] = `
"borderColor": undefined,
"borderRadius": 18,
"borderWidth": 0,
"elevation": 0,
"height": 36,
"margin": 6,
"overflow": "hidden",
"shadowColor": "#000000",
"shadowOffset": Object {
"height": 3,
"width": 0,
},
"shadowOpacity": 0.24,
"shadowRadius": 4,
"width": 36,
}
}
Expand Down Expand Up @@ -316,16 +310,10 @@ exports[`renders data table pagination 1`] = `
"borderColor": undefined,
"borderRadius": 18,
"borderWidth": 0,
"elevation": 0,
"height": 36,
"margin": 6,
"overflow": "hidden",
"shadowColor": "#000000",
"shadowOffset": Object {
"height": 3,
"width": 0,
},
"shadowOpacity": 0.24,
"shadowRadius": 4,
"width": 36,
}
}
Expand Down Expand Up @@ -450,16 +438,10 @@ exports[`renders data table pagination with fast-forward buttons 1`] = `
"borderColor": undefined,
"borderRadius": 18,
"borderWidth": 0,
"elevation": 0,
"height": 36,
"margin": 6,
"overflow": "hidden",
"shadowColor": "#000000",
"shadowOffset": Object {
"height": 3,
"width": 0,
},
"shadowOpacity": 0.24,
"shadowRadius": 4,
"width": 36,
}
}
Expand Down Expand Up @@ -530,16 +512,10 @@ exports[`renders data table pagination with fast-forward buttons 1`] = `
"borderColor": undefined,
"borderRadius": 18,
"borderWidth": 0,
"elevation": 0,
"height": 36,
"margin": 6,
"overflow": "hidden",
"shadowColor": "#000000",
"shadowOffset": Object {
"height": 3,
"width": 0,
},
"shadowOpacity": 0.24,
"shadowRadius": 4,
"width": 36,
}
}
Expand Down Expand Up @@ -610,16 +586,10 @@ exports[`renders data table pagination with fast-forward buttons 1`] = `
"borderColor": undefined,
"borderRadius": 18,
"borderWidth": 0,
"elevation": 0,
"height": 36,
"margin": 6,
"overflow": "hidden",
"shadowColor": "#000000",
"shadowOffset": Object {
"height": 3,
"width": 0,
},
"shadowOpacity": 0.24,
"shadowRadius": 4,
"width": 36,
}
}
Expand Down Expand Up @@ -690,16 +660,10 @@ exports[`renders data table pagination with fast-forward buttons 1`] = `
"borderColor": undefined,
"borderRadius": 18,
"borderWidth": 0,
"elevation": 0,
"height": 36,
"margin": 6,
"overflow": "hidden",
"shadowColor": "#000000",
"shadowOffset": Object {
"height": 3,
"width": 0,
},
"shadowOpacity": 0.24,
"shadowRadius": 4,
"width": 36,
}
}
Expand Down Expand Up @@ -824,16 +788,10 @@ exports[`renders data table pagination with label 1`] = `
"borderColor": undefined,
"borderRadius": 18,
"borderWidth": 0,
"elevation": 0,
"height": 36,
"margin": 6,
"overflow": "hidden",
"shadowColor": "#000000",
"shadowOffset": Object {
"height": 3,
"width": 0,
},
"shadowOpacity": 0.24,
"shadowRadius": 4,
"width": 36,
}
}
Expand Down Expand Up @@ -904,16 +862,10 @@ exports[`renders data table pagination with label 1`] = `
"borderColor": undefined,
"borderRadius": 18,
"borderWidth": 0,
"elevation": 0,
"height": 36,
"margin": 6,
"overflow": "hidden",
"shadowColor": "#000000",
"shadowOffset": Object {
"height": 3,
"width": 0,
},
"shadowOpacity": 0.24,
"shadowRadius": 4,
"width": 36,
}
}
Expand Down Expand Up @@ -1217,16 +1169,10 @@ exports[`renders data table pagination with options select 1`] = `
"borderColor": undefined,
"borderRadius": 18,
"borderWidth": 0,
"elevation": 0,
"height": 36,
"margin": 6,
"overflow": "hidden",
"shadowColor": "#000000",
"shadowOffset": Object {
"height": 3,
"width": 0,
},
"shadowOpacity": 0.24,
"shadowRadius": 4,
"width": 36,
}
}
Expand Down Expand Up @@ -1297,16 +1243,10 @@ exports[`renders data table pagination with options select 1`] = `
"borderColor": undefined,
"borderRadius": 18,
"borderWidth": 0,
"elevation": 0,
"height": 36,
"margin": 6,
"overflow": "hidden",
"shadowColor": "#000000",
"shadowOffset": Object {
"height": 3,
"width": 0,
},
"shadowOpacity": 0.24,
"shadowRadius": 4,
"width": 36,
}
}
Expand Down Expand Up @@ -1377,16 +1317,10 @@ exports[`renders data table pagination with options select 1`] = `
"borderColor": undefined,
"borderRadius": 18,
"borderWidth": 0,
"elevation": 0,
"height": 36,
"margin": 6,
"overflow": "hidden",
"shadowColor": "#000000",
"shadowOffset": Object {
"height": 3,
"width": 0,
},
"shadowOpacity": 0.24,
"shadowRadius": 4,
"width": 36,
}
}
Expand Down Expand Up @@ -1457,16 +1391,10 @@ exports[`renders data table pagination with options select 1`] = `
"borderColor": undefined,
"borderRadius": 18,
"borderWidth": 0,
"elevation": 0,
"height": 36,
"margin": 6,
"overflow": "hidden",
"shadowColor": "#000000",
"shadowOffset": Object {
"height": 3,
"width": 0,
},
"shadowOpacity": 0.24,
"shadowRadius": 4,
"width": 36,
}
}
Expand Down
Loading

0 comments on commit 95ff55b

Please sign in to comment.