Added instructions for .well-known method (supersedes #887) (#979)

* Added instructions for .well-known method

* Factor out SelectableBtn

* Rework the ChangeHandle modal to be a little clearer

* Fix lint

* Fix desktop layout

---------

Co-authored-by: Haider Ali Punjabi <haiderali@cyberservices.com>
Co-authored-by: Haider Ali Punjabi <haideralipunjabi@hackesta.org>
This commit is contained in:
Paul Frazee 2023-07-05 19:56:42 -05:00 committed by GitHub
parent fe32730025
commit 3a6073abb8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 170 additions and 107 deletions

View file

@ -0,0 +1,67 @@
import React from 'react'
import {Pressable, ViewStyle, StyleProp, StyleSheet} from 'react-native'
import {Text} from '../text/Text'
import {usePalette} from 'lib/hooks/usePalette'
import {isDesktopWeb} from 'platform/detection'
interface SelectableBtnProps {
selected: boolean
label: string
left?: boolean
right?: boolean
onSelect: () => void
accessibilityHint?: string
style?: StyleProp<ViewStyle>
}
export function SelectableBtn({
selected,
label,
left,
right,
onSelect,
accessibilityHint,
style,
}: SelectableBtnProps) {
const pal = usePalette('default')
const palPrimary = usePalette('inverted')
return (
<Pressable
style={[
styles.selectableBtn,
left && styles.selectableBtnLeft,
right && styles.selectableBtnRight,
pal.border,
selected ? palPrimary.view : pal.view,
style,
]}
onPress={onSelect}
accessibilityRole="button"
accessibilityLabel={label}
accessibilityHint={accessibilityHint}>
<Text style={selected ? palPrimary.text : pal.text}>{label}</Text>
</Pressable>
)
}
const styles = StyleSheet.create({
selectableBtn: {
flex: isDesktopWeb ? undefined : 1,
width: isDesktopWeb ? 100 : undefined,
flexDirection: 'row',
justifyContent: 'center',
borderWidth: 1,
borderLeftWidth: 0,
paddingHorizontal: 10,
paddingVertical: 10,
},
selectableBtnLeft: {
borderTopLeftRadius: 8,
borderBottomLeftRadius: 8,
borderLeftWidth: 1,
},
selectableBtnRight: {
borderTopRightRadius: 8,
borderBottomRightRadius: 8,
},
})