Skip to content

Commit 46b4ceb

Browse files
committed
docs: get started buttons adjustments, fix lint warnings
1 parent 85e304c commit 46b4ceb

File tree

3 files changed

+17
-7
lines changed

3 files changed

+17
-7
lines changed

docs/src/components/GetStartedButtons.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,23 @@ const styles = StyleSheet.create({
2222
},
2323
});
2424

25+
const noTextDecoration = {
26+
textDecoration: 'none',
27+
};
28+
29+
// Needed for ripple effect when pressing `Button`, however navigation is handled by `Link`
30+
const noop = () => {};
31+
2532
const GetStartedButton = () => {
2633
return (
2734
<View style={styles.container}>
28-
<Link to="docs/guides/getting-started" style={{ textDecoration: 'none' }}>
29-
<Button mode="elevated" style={styles.button}>
35+
<Link to="docs/guides/getting-started" style={noTextDecoration}>
36+
<Button mode="contained" style={styles.button} onPress={noop}>
3037
Get started
3138
</Button>
3239
</Link>
3340
<Button
34-
mode="elevated"
41+
mode="outlined"
3542
onPress={() =>
3643
window.open(
3744
'https://snack.expo.dev/@react-native-paper/react-native-paper-example_v5'

docs/src/components/Showcase.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,8 @@ const data: Data[] = [
161161
},
162162
];
163163

164+
const getOpacity = (item?: string) => (item ? 1 : 0.4);
165+
164166
export default function Showcase() {
165167
return (
166168
<div className="showcase-gallery">
@@ -187,7 +189,7 @@ export default function Showcase() {
187189
href={item.android}
188190
target="_blank"
189191
rel="noopener noreferrer"
190-
style={{ opacity: item.android ? 1 : 0.4 }}
192+
style={{ opacity: getOpacity(item.android) }}
191193
>
192194
<GooglePlayIcon color={tintColor} />
193195
</a>
@@ -196,7 +198,7 @@ export default function Showcase() {
196198
href={item.ios}
197199
target="_blank"
198200
rel="noopener noreferrer"
199-
style={{ opacity: item.ios ? 1 : 0.4 }}
201+
style={{ opacity: getOpacity(item.ios) }}
200202
>
201203
<AppStoreIcon color={tintColor} />
202204
</a>
@@ -205,7 +207,7 @@ export default function Showcase() {
205207
href={item.github}
206208
target="_blank"
207209
rel="noopener noreferrer"
208-
style={{ opacity: item.github ? 1 : 0.4 }}
210+
style={{ opacity: getOpacity(item.github) }}
209211
>
210212
<GithubIcon color={tintColor} />
211213
</a>

docs/src/components/Switch.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ interface SwitchProps {
77
}
88

99
const Switch = ({ value, onValueChange, color }: SwitchProps) => {
10+
const background = value ? color : 'none';
1011
return (
1112
<>
1213
<input
@@ -17,7 +18,7 @@ const Switch = ({ value, onValueChange, color }: SwitchProps) => {
1718
type="checkbox"
1819
/>
1920
<label
20-
style={{ background: value ? color : 'none' }}
21+
style={{ background }}
2122
className="react-switch-label"
2223
htmlFor={`react-switch-new`}
2324
>

0 commit comments

Comments
 (0)