chore: snapshot before performance optimization
This commit is contained in:
17
keep-notes/update_toggle_dir.py
Normal file
17
keep-notes/update_toggle_dir.py
Normal file
@@ -0,0 +1,17 @@
|
||||
with open('components/notes-view-toggle.tsx', 'r') as f:
|
||||
content = f.read()
|
||||
|
||||
# Add language to useLanguage()
|
||||
content = content.replace(
|
||||
'const { t } = useLanguage()',
|
||||
'const { t, language } = useLanguage()'
|
||||
)
|
||||
|
||||
# Add dir to div wrapper
|
||||
content = content.replace(
|
||||
'className={cn(\n \'inline-flex rounded-full border border-border bg-muted/40 p-0.5 shadow-sm\',\n className\n )}',
|
||||
'dir={language === \'fa\' || language === \'ar\' ? \'rtl\' : \'ltr\'}\n className={cn(\n \'inline-flex rounded-full border border-border bg-muted/40 p-0.5 shadow-sm\',\n className\n )}'
|
||||
)
|
||||
|
||||
with open('components/notes-view-toggle.tsx', 'w') as f:
|
||||
f.write(content)
|
||||
Reference in New Issue
Block a user