Skip to content

Commit

Permalink
style changes to ls command
Browse files Browse the repository at this point in the history
  • Loading branch information
Opeyem1a committed Oct 27, 2024
1 parent 5531f5f commit a539315
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/commands/list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export const List = () => {
return (
<Box flexDirection="column" gap={0}>
{nodes.map((node) => {
const isCurrent = currentBranch.value === node.name;
const style = styleMap[
node.prefix.length % styleMap.length
] as TextStyle;
Expand All @@ -83,18 +84,19 @@ export const List = () => {
elements={[
...node.prefix,
{
symbols:
currentBranch.value === node.name
? '⊗'
: '◯',
symbols: isCurrent ? '⊗' : '◯',
},
...node.suffix,
]}
/>
<Spaces count={maxWidth + 2 - node.width} />
<Spaces
count={
maxWidth + 2 - node.width + (isCurrent ? 0 : 2)
}
/>
<Text color={style.color} dimColor={style.dimColor}>
{isCurrent ? ' 👉 ' : ''}
{node.name}{' '}
{currentBranch.value === node.name ? '👈' : ''}
</Text>
</Text>
);
Expand Down

0 comments on commit a539315

Please sign in to comment.