-
-
Notifications
You must be signed in to change notification settings - Fork 523
refactor: config file TBD #1348
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
base: master
Are you sure you want to change the base?
Conversation
|
Size Change: +61 B (+0.01%) Total Size: 449 kB
ℹ️ View Unchanged
|
| const LOGOS = [ | ||
| { | ||
| name: 'logo-text', | ||
| alt: 'Full Logo' | ||
| }, | ||
| { | ||
| name: 'logo-text-inverted', | ||
| alt: 'Full Logo with Inverted Colors' | ||
| }, | ||
| { | ||
| name: 'symbol', | ||
| alt: 'Preact Symbol' | ||
| }, | ||
| { | ||
| name: 'symbol-inverted', | ||
| alt: 'Preact Symbol with Inverted Colors' | ||
| } | ||
| ]; |
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.
Hoisting this out of the component made little sense, this was the only consumer (I wrote this, to be clear -- dunno why I did, but I did)
| "tutorial": { | ||
| "begin": { | ||
| "en": "Begin Tutorial", | ||
| "kr": "튜토리얼 시작", | ||
| "ru": "Начать обучение", | ||
| "zh": "开始教程" | ||
| }, | ||
| "help": { | ||
| "en": "Help", | ||
| "ja": "助ける", | ||
| "kr": "정답 확인", | ||
| "ru": "Помощь", | ||
| "zh": "帮助" | ||
| }, | ||
| "solve": { | ||
| "en": "Solve", | ||
| "ja": "説き明かす", | ||
| "ru": "Решить", | ||
| "zh": "解决" | ||
| } | ||
| "beginTutorial": { | ||
| "en": "Begin Tutorial", | ||
| "kr": "튜토리얼 시작", | ||
| "ru": "Начать обучение", | ||
| "zh": "开始教程" | ||
| }, | ||
| "help": { | ||
| "en": "Help", | ||
| "ja": "助ける", | ||
| "kr": "정답 확인", | ||
| "ru": "Помощь", | ||
| "zh": "帮助" | ||
| }, | ||
| "solve": { | ||
| "en": "Solve", | ||
| "ja": "説き明かす", | ||
| "ru": "Решить", | ||
| "zh": "解决" |
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.
Flattening this out makes it a bit easier & more consistent to access (useTranslation) for little loss; the nesting only gives an indication of where the string is used, nothing essential.
| function SiblingNav({ route, lang, start }) { | ||
| let title = ''; | ||
| let url = ''; | ||
| if (route) { | ||
| url = route.path.toLowerCase(); | ||
| title = | ||
| typeof route.name === 'object' | ||
| ? route.name[lang || 'en'] | ||
| : route.name || route.title; | ||
| } | ||
| const label = useTranslation(start ? 'previous' : 'next'); | ||
|
|
||
| return ( | ||
| <a class={style.nextLink} data-dir-end={!start} href={url}> | ||
| {start && <span class={style.icon}>← </span>} | ||
| {!start && <span class={style.icon}> →</span>} | ||
| <span class={style.nextInner}> | ||
| <span class={style.nextTitle}> | ||
| <span class={style.nextTitleInner}>{title}</span> | ||
| </span> | ||
| <span class={style.nextUrl}>{label}</span> | ||
| </span> | ||
| </a> | ||
| ); | ||
| } | ||
|
|
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.
Whilst looking at our use of useTranslation I came across this which seems to have been long unused. Created in #650 but removed at some point, this is all unused.
| "zh": "简体中文" | ||
| }, | ||
| "repo": "preact", | ||
| "repo": "preactjs/preact", |
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.
Not against just inlining the string altogether, but if we do have it hoisted to our app-wide config, feels like org + repo makes more sense.
5aaa6ef to
325eeb3
Compare
No description provided.