Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: address some deprecations warnings take 1/n #1804

Closed
wants to merge 23 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
b6a896f
fix: use `verticalAlign` instead of `textAlignVertical`
ecreeth Nov 3, 2023
5afa787
fix: use `role` instead of `accessibilityRole`
ecreeth Nov 3, 2023
8abf93f
fix: use `aria-label` instead of `accessibilityLabel`
ecreeth Nov 3, 2023
4862fd5
fix(UserBanner): [expo-image]: Prop "resizeMode" is deprecated, use "…
ecreeth Nov 3, 2023
a000311
fix: don't set `accessibilityRole` and `role` the same time
ecreeth Nov 3, 2023
361fd26
fix: remove duplicated `accessibilityLabel` in `TextInput`
ecreeth Nov 3, 2023
66d5a44
fix: removed duplicarted `accessibilityRole` props
ecreeth Nov 3, 2023
82821dd
fix(bottom-bar): `btn` not getting the role and `aria-label` prop
ecreeth Nov 3, 2023
72e00e8
fix: removed `accessibilityRole` props
ecreeth Nov 3, 2023
1338567
fix: use `id` instead of `testID` for `UserBanner` expo-image use to …
ecreeth Nov 3, 2023
cfd2e46
chore: removed `accessibilityLabel`
ecreeth Nov 3, 2023
8b21a82
fix: some component props handling `accessibilityLabel` as prop
ecreeth Nov 3, 2023
916ee96
Merge remote-tracking branch 'origin/main' into fix-deprecations
ecreeth Nov 3, 2023
de7a14d
refactor: use `enterKeyHint` instead of `returnKeyType`
ecreeth Nov 3, 2023
e41d619
refactor: use `role` instead of `accessibilityRole`
ecreeth Nov 3, 2023
692ab93
refactor: removed todo
ecreeth Nov 3, 2023
df60a61
refactor: don't set duplicates`accessibilityLabel` props
ecreeth Nov 3, 2023
874c9d4
refactor: don't add props that weren't used before
ecreeth Nov 3, 2023
9f88bda
chore: removed unused todo
ecreeth Nov 3, 2023
9c7978c
refactor: use `id` instead of `nativeId`
ecreeth Nov 3, 2023
3eba61b
refactor: move `pointerEvents` prop to pointerEvents style
ecreeth Nov 3, 2023
c9047e6
refactor: replaced `accessibilityLabelledBy` with `aria-labelledby`
ecreeth Nov 3, 2023
8d3d004
Merge branch 'main' into fix-deprecations
ecreeth Nov 3, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/view/com/auth/SplashScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ export const SplashScreen = ({
testID="createAccountButton"
style={[styles.btn, {backgroundColor: colors.blue3}]}
onPress={onPressCreateAccount}
accessibilityRole="button"
accessibilityLabel="Create new account"
role="button"
aria-label="Create new account"
accessibilityHint="Opens flow to create a new Bluesky account">
<Text style={[s.white, styles.btnLabel]}>
Create a new account
Expand All @@ -40,8 +40,8 @@ export const SplashScreen = ({
testID="signInButton"
style={[styles.btn, pal.btn]}
onPress={onPressSignin}
accessibilityRole="button"
accessibilityLabel="Sign in"
role="button"
aria-label="Sign in"
accessibilityHint="Opens flow to sign into your existing Bluesky account">
<Text style={[pal.text, styles.btnLabel]}>Sign In</Text>
</TouchableOpacity>
Expand Down
6 changes: 2 additions & 4 deletions src/view/com/auth/SplashScreen.web.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ export const SplashScreen = ({
testID="createAccountButton"
style={[styles.btn, {backgroundColor: colors.blue3}]}
onPress={onPressCreateAccount}
// TODO: web accessibility
accessibilityRole="button">
role="button">
<Text style={[s.white, styles.btnLabel]}>
Create a new account
</Text>
Expand All @@ -52,8 +51,7 @@ export const SplashScreen = ({
testID="signInButton"
style={[styles.btn, pal.btn]}
onPress={onPressSignin}
// TODO: web accessibility
accessibilityRole="button">
role="button">
<Text style={[pal.text, styles.btnLabel]}>Sign In</Text>
</TouchableOpacity>
</View>
Expand Down
8 changes: 4 additions & 4 deletions src/view/com/auth/create/CreateAccount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export const CreateAccount = observer(function CreateAccountImpl({
<TouchableOpacity
onPress={onPressBackInner}
testID="backBtn"
accessibilityRole="button">
role="button">
<Text type="xl" style={pal.link}>
Back
</Text>
Expand All @@ -94,7 +94,7 @@ export const CreateAccount = observer(function CreateAccountImpl({
<TouchableOpacity
testID="nextBtn"
onPress={onPressNext}
accessibilityRole="button">
role="button">
{model.isProcessing ? (
<ActivityIndicator />
) : (
Expand All @@ -107,8 +107,8 @@ export const CreateAccount = observer(function CreateAccountImpl({
<TouchableOpacity
testID="retryConnectBtn"
onPress={onPressRetryConnect}
accessibilityRole="button"
accessibilityLabel="Retry"
role="button"
aria-label="Retry"
accessibilityHint="Retries account creation"
accessibilityLiveRegion="polite">
<Text type="xl-bold" style={[pal.link, s.pr5]}>
Expand Down
12 changes: 7 additions & 5 deletions src/view/com/auth/create/Step1.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,20 @@ export const Step1 = observer(function Step1Impl({
label="Other"
onPress={onPressOther}>
<View style={styles.otherForm}>
<Text nativeID="addressProvider" style={[pal.text, s.mb5]}>
<Text id="addressProvider" style={[pal.text, s.mb5]}>
Enter the address of your provider:
</Text>
<TextInput
accessibilityLabel="Text input field"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is added automatically by lint-staged

testID="customServerInput"
icon="globe"
placeholder="Hosting provider address"
value={model.serviceUrl}
editable
onChange={onChangeServiceUrl}
accessibilityHint="Input hosting provider address"
accessibilityLabel="Hosting provider address"
accessibilityLabelledBy="addressProvider"
aria-label="Hosting provider address"
aria-labelledby="addressProvider"
/>
{LOGIN_INCLUDE_DEV_SERVERS && (
<View style={[s.flexRow, s.mt10]}>
Expand Down Expand Up @@ -148,10 +149,11 @@ function Option({
return (
<View style={[styles.option, pal.border]}>
<TouchableWithoutFeedback
accessibilityRole="button"
onPress={onPress}
testID={testID}
accessibilityRole="button"
accessibilityLabel={label}
role="button"
aria-label={label}
accessibilityHint={`Sets hosting provider to ${label}`}>
<View style={styles.optionHeading}>
<View style={[styles.circle, pal.border]}>
Expand Down
33 changes: 16 additions & 17 deletions src/view/com/auth/create/Step2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,14 @@ export const Step2 = observer(function Step2Impl({
Invite code
</Text>
<TextInput
accessibilityLabel="Text input field"
testID="inviteCodeInput"
icon="ticket"
placeholder="Required for this provider"
value={model.inviteCode}
editable
onChange={model.setInviteCode}
accessibilityLabel="Invite code"
aria-label="Invite code"
accessibilityHint="Input invite code to proceed"
/>
</View>
Expand All @@ -60,8 +61,10 @@ export const Step2 = observer(function Step2Impl({
<Text style={[s.alignBaseline, pal.text]}>
Don't have an invite code?{' '}
<TouchableWithoutFeedback
accessibilityRole="button"
role="button"
onPress={onPressWaitlist}
accessibilityLabel="Join the waitlist."
aria-label="Join the waitlist."
accessibilityHint="">
<View style={styles.touchable}>
<Text style={pal.link}>Join the waitlist.</Text>
Expand All @@ -71,48 +74,44 @@ export const Step2 = observer(function Step2Impl({
) : (
<>
<View style={s.pb20}>
<Text type="md-medium" style={[pal.text, s.mb2]} nativeID="email">
<Text type="md-medium" style={[pal.text, s.mb2]} id="email">
Email address
</Text>
<TextInput
accessibilityLabel="Text input field"
testID="emailInput"
icon="envelope"
placeholder="Enter your email address"
value={model.email}
editable
onChange={model.setEmail}
accessibilityLabel="Email"
aria-label="Email"
accessibilityHint="Input email for Bluesky waitlist"
accessibilityLabelledBy="email"
aria-labelledby="email"
/>
</View>

<View style={s.pb20}>
<Text
type="md-medium"
style={[pal.text, s.mb2]}
nativeID="password">
<Text type="md-medium" style={[pal.text, s.mb2]} id="password">
Password
</Text>
<TextInput
accessibilityLabel="Text input field"
testID="passwordInput"
icon="lock"
placeholder="Choose your password"
value={model.password}
editable
secureTextEntry
onChange={model.setPassword}
accessibilityLabel="Password"
aria-label="Password"
accessibilityHint="Set password"
accessibilityLabelledBy="password"
aria-labelledby="password"
/>
</View>

<View style={s.pb20}>
<Text
type="md-medium"
style={[pal.text, s.mb2]}
nativeID="birthDate">
<Text type="md-medium" style={[pal.text, s.mb2]} id="birthDate">
Your birth date
</Text>
<DateInput
Expand All @@ -122,9 +121,9 @@ export const Step2 = observer(function Step2Impl({
buttonType="default-light"
buttonStyle={[pal.border, styles.dateInputButton]}
buttonLabelType="lg"
accessibilityLabel="Birthday"
aria-label="Birthday"
accessibilityHint="Enter your birth date"
accessibilityLabelledBy="birthDate"
aria-labelledby="birthDate"
/>
</View>

Expand Down
2 changes: 1 addition & 1 deletion src/view/com/auth/create/Step3.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const Step3 = observer(function Step3Impl({
editable
onChange={model.setHandle}
// TODO: Add explicit text label
accessibilityLabel="User handle"
aria-label="User handle"
accessibilityHint="Input your user handle"
/>
<Text type="lg" style={[pal.text, s.pl5, s.pt10]}>
Expand Down
Loading