-
Notifications
You must be signed in to change notification settings - Fork 524
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
Add context to provide rtl support for react-icons #560
base: main
Are you sure you want to change the base?
Changes from all commits
31c7a3f
47fae8d
8f81a86
179a3e7
55e3032
1cfdd33
66d5a05
c84e246
80bef55
37a69cb
39b3d32
9c0439c
fd04253
53e77d3
afb2431
7507fae
3b6e5f9
b502589
0d89f78
66f1019
6832725
5327af7
7b0bbb9
adab308
10cf5fe
3ec81c8
74ea042
934daf2
71ecb5b
772f374
995334e
b0573ab
a1e8486
8fabcae
9da091e
9e1d6e9
07e1691
3a10737
dfdc77e
12b991c
f7f417f
1573195
bc6674b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,8 +16,8 @@ | |
"cleanSvg": "rm -rf ./intermediate", | ||
"copy": "node ../../importer/generate.js --source=../../assets --dest=./intermediate --extension=svg --target=react", | ||
"copy:font-files": "cpy './src/utils/fonts/*.{ttf,woff,woff2,json}' ./lib/utils/fonts/. && cpy './src/utils/fonts/*.{ttf,woff,woff2,json}' ./lib-cjs/utils/fonts/.", | ||
"convert:svg": "node convert.js --source=./intermediate --dest=./src", | ||
"convert:fonts": "node convert-font.js --source=./src/utils/fonts --dest=./src/fonts --codepointDest=./src/utils/fonts", | ||
"convert:svg": "node convert.js --source=./intermediate --dest=./src --filter=../../importer/rtl.txt", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't see There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The I am wary about creating a new file for this because this file was already created by the designers to track icons that should be flipped in rtl There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need to track down with the Android folks (that's the only platform previously using the rtl.txt file) what is/isn't there. RTL wasn't kept up with, for the most part, as other platforms didn't need/use it. |
||
"convert:fonts": "node convert-font.js --source=./src/utils/fonts --dest=./src/fonts --codepointDest=./src/utils/fonts --filter=../../importer/rtl.txt", | ||
"generate:font-regular": "node ../../importer/generateFont.js --source=intermediate --dest=src/utils/fonts --iconType=Regular --codepoints=../../fonts/FluentSystemIcons-Regular.json", | ||
"generate:font-filled": "node ../../importer/generateFont.js --source=intermediate --dest=src/utils/fonts --iconType=Filled --codepoints=../../fonts/FluentSystemIcons-Filled.json", | ||
"generate:font-resizable": "node ../../importer/generateFont.js --source=intermediate --dest=src/utils/fonts --iconType=Resizable", | ||
|
@@ -81,4 +81,3 @@ | |
} | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import * as React from 'react'; | ||
|
||
const IconDirectionContext = React.createContext<IconDirectionContextValue | undefined>(undefined); | ||
|
||
export interface IconDirectionContextValue { | ||
textDirection?: 'ltr' | 'rtl' | ||
} | ||
|
||
const IconDirectionContextDefaultValue: IconDirectionContextValue = {}; | ||
|
||
export const IconDirectionContextProvider = IconDirectionContext.Provider; | ||
|
||
export const useIconContext = () => React.useContext(IconDirectionContext) ?? IconDirectionContextDefaultValue; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './IconDirectionContext'; |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
filter
is a confusing name for this arg. How aboutflip_in_rtl
?Ditto for the file name:
flip_in_rtl.txt
instead ofrtl.txt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possibly even autoflip_in_rtl