ai/at
1
0

add ios social-app

This commit is contained in:
2025-12-06 21:14:08 +09:00
parent 948551c185
commit b15994e5c0
37 changed files with 501 additions and 159 deletions

67
ios/patch_drawer_links.py Normal file
View File

@@ -0,0 +1,67 @@
import sys
file_path = sys.argv[1]
with open(file_path, 'r') as f:
lines = f.readlines()
new_lines = []
in_extra_links = False
extra_links_replaced = False
# We will replace the entire ExtraLinks function
extra_links_code = """
function ExtraLinks() {
const {_} = useLingui()
const t = useTheme()
const kawaii = useKawaiiMode()
const navigation = useNavigation<NavigationProp>()
return (
<View style={[a.flex_col, a.gap_md, a.flex_wrap]}>
<TouchableOpacity onPress={() => navigation.navigate('TermsOfService')}>
<Text style={[a.text_md, t.atoms.text_contrast_medium]}>
<Trans>Terms of Service</Trans>
</Text>
</TouchableOpacity>
<TouchableOpacity onPress={() => navigation.navigate('PrivacyPolicy')}>
<Text style={[a.text_md, t.atoms.text_contrast_medium]}>
<Trans>Privacy Policy</Trans>
</Text>
</TouchableOpacity>
{kawaii && (
<Text style={t.atoms.text_contrast_medium}>
<Trans>
Logo by{' '}
<InlineLinkText
style={[a.text_md]}
to="/profile/sawaratsuki.bsky.social"
label="@sawaratsuki.bsky.social">
@sawaratsuki.bsky.social
</InlineLinkText>
</Trans>
</Text>
)}
</View>
)
}
"""
for line in lines:
if 'function ExtraLinks() {' in line:
in_extra_links = True
new_lines.append(extra_links_code)
continue
if in_extra_links:
if line.strip() == '}':
in_extra_links = False
# Don't append the closing brace because extra_links_code includes it?
# Wait, extra_links_code includes the whole function.
# So we skip everything until LAST closing brace of function.
# Simple heuristic: indentation.
continue
new_lines.append(line)
with open(file_path, 'w') as f:
f.write(''.join(new_lines))