Skip to content

Commit eb7aeb0

Browse files
committed
Add a folder info label to the workspace dropdown in the Home view and adjust its styling
- translate [Fragment]
1 parent 529987c commit eb7aeb0

3 files changed

Lines changed: 50 additions & 10 deletions

File tree

‎apps/editor/src/views/panel/frontend/Home/Home.module.scss‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
position: relative;
119119
height: 24px;
120120
flex: 1;
121-
margin-right: 8px;
121+
margin-right: 6px;
122122
}
123123

124124
&__tasks {

‎apps/editor/src/views/panel/frontend/Home/Home.tsx‎

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,18 @@ type Props = {
4848

4949
export const Home: React.FC<Props> = (props) => {
5050
const { t } = use_translation()
51-
const [active_tab, set_active_tab] = useState<'tasks' | 'checkpoints'>('tasks')
51+
const [active_tab, set_active_tab] = useState<'tasks' | 'checkpoints'>(
52+
'tasks'
53+
)
5254
const [active_workspace_root, set_active_workspace_root] = useState<string>()
53-
const { is_mode_sticky, is_hiding, responses_ref, mode_ref, handle_scroll } = use_sticky_mode()
55+
const { is_mode_sticky, is_hiding, responses_ref, mode_ref, handle_scroll } =
56+
use_sticky_mode()
5457

5558
const roots = Object.keys(props.tasks)
56-
const active_root = active_workspace_root && roots.includes(active_workspace_root) ? active_workspace_root : roots[0]
59+
const active_root =
60+
active_workspace_root && roots.includes(active_workspace_root)
61+
? active_workspace_root
62+
: roots[0]
5763

5864
useEffect(() => {
5965
const handle_mouse_up = (event: MouseEvent) => {
@@ -165,7 +171,9 @@ export const Home: React.FC<Props> = (props) => {
165171
{ id: 'checkpoints', label: t('home.checkpoints') }
166172
]}
167173
active_tab={active_tab}
168-
on_tab_change={(id) => set_active_tab(id as 'tasks' | 'checkpoints')}
174+
on_tab_change={(id) =>
175+
set_active_tab(id as 'tasks' | 'checkpoints')
176+
}
169177
actions={
170178
active_tab == 'tasks' ? (
171179
<>
@@ -178,6 +186,7 @@ export const Home: React.FC<Props> = (props) => {
178186
}))}
179187
selected_value={active_root!}
180188
on_change={(val) => set_active_workspace_root(val)}
189+
info={t('home.folder')}
181190
/>
182191
</div>
183192
)}
@@ -188,7 +197,11 @@ export const Home: React.FC<Props> = (props) => {
188197
on_click={(e) => {
189198
e.stopPropagation()
190199
if (active_root) {
191-
handle_add(active_root, props.tasks[active_root], 'top')
200+
handle_add(
201+
active_root,
202+
props.tasks[active_root],
203+
'top'
204+
)
192205
}
193206
}}
194207
/>
@@ -249,13 +262,21 @@ export const Home: React.FC<Props> = (props) => {
249262
handle_reorder(active_root, new_tasks)
250263
}
251264
on_change={(updated_task) => {
252-
handle_change(active_root, props.tasks[active_root], updated_task)
265+
handle_change(
266+
active_root,
267+
props.tasks[active_root],
268+
updated_task
269+
)
253270
}}
254271
on_add={() => {
255272
handle_add(active_root, props.tasks[active_root])
256273
}}
257274
on_add_subtask={(parent_task) => {
258-
handle_add_subtask(active_root, props.tasks[active_root], parent_task)
275+
handle_add_subtask(
276+
active_root,
277+
props.tasks[active_root],
278+
parent_task
279+
)
259280
}}
260281
on_delete={(timestamp) => {
261282
handle_delete(active_root, timestamp)
@@ -277,7 +298,9 @@ export const Home: React.FC<Props> = (props) => {
277298
<UiCheckpoints
278299
items={props.checkpoints.map((c) => ({
279300
id: c.timestamp,
280-
label: t(`command.checkpoints.trigger.${c.trigger}` as any),
301+
label: t(
302+
`command.checkpoints.trigger.${c.trigger}` as any
303+
),
281304
timestamp: c.timestamp,
282305
description: c.description,
283306
is_starred: c.is_starred,
@@ -315,7 +338,6 @@ export const Home: React.FC<Props> = (props) => {
315338
</div>
316339
</div>
317340
</UiScrollable>
318-
319341
</>
320342
)
321343
}

‎apps/editor/src/views/panel/frontend/i18n/translations/home.ts‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,24 @@ export const home = {
7171
hu: 'Kattintson szöveg hozzáadásához...',
7272
bg: 'Кликнете, за да добавите текст...'
7373
},
74+
'home.folder': {
75+
en: 'Folder',
76+
pl: 'Folder',
77+
'zh-cn': '文件夹',
78+
ja: 'フォルダー',
79+
'zh-tw': '資料夾',
80+
de: 'Ordner',
81+
es: 'Carpeta',
82+
fr: 'Dossier',
83+
'pt-br': 'Pasta',
84+
ru: 'Папка',
85+
ko: '폴더',
86+
it: 'Cartella',
87+
tr: 'Klasör',
88+
cs: 'Složka',
89+
hu: 'Mappa',
90+
bg: 'Папка'
91+
},
7492
'home.footer.copyright': {
7593
en: 'Copyright © {year} {link}',
7694
pl: 'Copyright © {year} {link}',

0 commit comments

Comments
 (0)