Skip to content

Commit

Permalink
1077-support-folder-structure-for-non-multi-file (#1269)
Browse files Browse the repository at this point in the history
Make it possible to add folders/groups for sets. This should work the
same as the feature in Multi File:
Simply renam token sets to have a folder path, eg folder/set-1 ,
folder/set-2

Co-authored-by: hiroshi <robinhoodie0823@gmail.com>
  • Loading branch information
swordEdge and robinhoodie0823 authored Sep 8, 2022
1 parent c569f12 commit 74f6ea1
Showing 1 changed file with 8 additions and 22 deletions.
30 changes: 8 additions & 22 deletions src/app/components/TokenSetSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@ import Modal from './Modal';
import TokenSetTree from './TokenSetTree';
import Box from './Box';
import { styled } from '@/stitches.config';
import TokenSetList from './TokenSetList';
import {
editProhibitedSelector, tokensSelector,
} from '@/selectors';
import Stack from './Stack';
import { useIsGitMultiFileEnabled } from '../hooks/useIsGitMultiFileEnabled';

const StyledButton = styled('button', {
flexShrink: 0,
Expand All @@ -37,7 +35,6 @@ const StyledButton = styled('button', {
export default function TokenSetSelector({ saveScrollPositionSet } : { saveScrollPositionSet: (tokenSet: string) => void }) {
const tokens = useSelector(tokensSelector);
const editProhibited = useSelector(editProhibitedSelector);
const mfsEnabled = useIsGitMultiFileEnabled();
const dispatch = useDispatch<Dispatch>();
const { confirm } = useConfirm();

Expand Down Expand Up @@ -144,25 +141,14 @@ export default function TokenSetSelector({ saveScrollPositionSet } : { saveScrol
}}
className="content"
>
{mfsEnabled ? (
<TokenSetTree
tokenSets={allTokenSets}
onRename={handleRenameTokenSet}
onDelete={handleDelete}
onDuplicate={handleDuplicateTokenSet}
onReorder={handleReorder}
saveScrollPositionSet={saveScrollPositionSet}
/>
) : (
<TokenSetList
onReorder={handleReorder}
tokenSets={allTokenSets}
onRename={handleRenameTokenSet}
onDelete={handleDeleteTokenSet}
onDuplicate={handleDuplicateTokenSet}
saveScrollPositionSet={saveScrollPositionSet}
/>
)}
<TokenSetTree
tokenSets={allTokenSets}
onRename={handleRenameTokenSet}
onDelete={handleDelete}
onDuplicate={handleDuplicateTokenSet}
onReorder={handleReorder}
saveScrollPositionSet={saveScrollPositionSet}
/>
<Modal
isOpen={showRenameTokenSetFields}
close={handleCloseRenameModal}
Expand Down

0 comments on commit 74f6ea1

Please sign in to comment.