Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/ui/components/NodeList/NodeRow.css
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
grid-column: 1 / span 2;
}

.ns {
cursor: unset;
grid-column: 1 / span 2;
}

.disabled {
color: var(--figma-color-text-disabled);
}
1 change: 1 addition & 0 deletions src/ui/components/NodeList/NodeRow.css.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ declare const styles: {
readonly "container": string;
readonly "disabled": string;
readonly "key": string;
readonly "ns": string;
readonly "text": string;
};
export = styles;
Expand Down
1 change: 1 addition & 0 deletions src/ui/components/NodeList/NodeRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export const NodeRow = ({
{keyComponent ? keyComponent : node.key}
</div>
<div
className={styles.ns}
title="Translation namespace"
data-cy="general_node_list_row_namespace"
>
Expand Down
118 changes: 58 additions & 60 deletions src/ui/views/Index/Index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,64 +114,66 @@ export const Index = () => {
space="medium"
style={{ paddingBlock: "var(--space-extra-small)" }}
>
{editorMode.data !== "dev" && (
<TopBar
leftPart={
<Fragment>
{languages && (
<select
data-cy="index_language_select"
className={styles.languageContainer}
value={language}
onChange={(e) => {
handleLanguageChange(
(e.target as HTMLInputElement).value
);
}}
>
{languages.map((l) => (
<option key={l.tag} value={l.tag}>
{l.name}
</option>
))}
</select>
)}

<Button data-cy="index_push_button" onClick={handlePush}>
{nothingSelected ? "Push all" : "Push"}
</Button>

<Button
data-cy="index_pull_button"
onClick={handlePull}
secondary
<TopBar
leftPart={
<Fragment>
{languages && editorMode.data !== "dev" && (
<select
data-cy="index_language_select"
className={styles.languageContainer}
value={language}
onChange={(e) => {
handleLanguageChange(
(e.target as HTMLInputElement).value
);
}}
>
{nothingSelected ? "Pull all" : "Pull"}
</Button>
{languages.map((l) => (
<option key={l.tag} value={l.tag}>
{l.name}
</option>
))}
</select>
)}

<Button data-cy="index_push_button" onClick={handlePush}>
{nothingSelected ? "Push all" : "Push"}
</Button>

{editorMode.data !== "dev" && (
<Fragment>
<Button
data-cy="index_pull_button"
onClick={handlePull}
secondary
>
{nothingSelected ? "Pull all" : "Pull"}
</Button>

<Button
data-cy="index_create_copy_button"
onClick={handleCopy}
secondary
>
Create a copy
</Button>
</Fragment>
}
rightPart={
<div style={{ display: "flex", alignItems: "center", gap: 8 }}>
<div
data-cy="index_settings_button"
className={styles.settingsButton}
onClick={() => setRoute("settings")}
role="button"
>
<Settings width={15} height={15} />
</div>
<Button
data-cy="index_create_copy_button"
onClick={handleCopy}
secondary
>
Copy
</Button>
</Fragment>
)}
</Fragment>
}
rightPart={
<div style={{ display: "flex", alignItems: "center", gap: 8 }}>
<div
data-cy="index_settings_button"
className={styles.settingsButton}
onClick={() => setRoute("settings")}
role="button"
>
<Settings width={15} height={15} />
</div>
}
/>
)}
</div>
}
/>
</Container>
<Divider />
<Container space="medium">
Expand Down Expand Up @@ -200,11 +202,7 @@ export const Index = () => {
</Container>
) : (
<NodeList
items={
editorMode.data !== "dev"
? selection
: selection.filter((n) => n.connected)
}
items={selection}
row={(node) => (
<ListItem
node={node}
Expand Down
2 changes: 2 additions & 0 deletions src/ui/views/Push/Changes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export const Changes = ({ changes }: Props) => {
data-cy="changes_new_keys"
>
<NodeList
rowHeight={28}
items={changes.newKeys.map((k) => ({
id: k.key,
key: k.key,
Expand All @@ -47,6 +48,7 @@ export const Changes = ({ changes }: Props) => {
data-cy="changes_changed_keys"
>
<NodeList
rowHeight={28}
items={changes.changedKeys.map((k) => ({
id: k.key,
key: k.key,
Expand Down
4 changes: 3 additions & 1 deletion src/ui/views/Router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { CopyView } from "./CopyView/CopyView";
import { Dialog } from "../components/Dialog/Dialog";
import { StringDetails } from "./StringDetails/StringDetails";
import { ResizeHandle } from "../components/ResizeHandle/ResizeHandle";
import { useEditorMode } from "../hooks/useEditorMode";

const getDialogPage = ([routeKey, routeData]: Route) => {
switch (routeKey) {
Expand Down Expand Up @@ -68,6 +69,7 @@ export const Router = () => {
const pageStringDetails = useGlobalState((c) => c.config?.pageStringDetails);
const pageStringDetailsNodeInfo = useGlobalState((c) => c.config?.nodeInfo);
const { setRoute } = useGlobalActions();
const editorMode = useEditorMode();

const forceSettings = !pageCopy && !documentInfo;
const errorOnTop = !forceSettings && routeKey !== "settings";
Expand Down Expand Up @@ -98,7 +100,7 @@ export const Router = () => {
) : (
<Page route={route} setRoute={setRoute} />
)}
<ResizeHandle />
{editorMode.data !== "dev" && <ResizeHandle />}
</Fragment>
);
};
Loading