Skip to content

Commit

Permalink
Trim space name, fix name input layout.
Browse files Browse the repository at this point in the history
  • Loading branch information
David Emanuel Luksic committed Dec 30, 2022
1 parent 4f54fea commit c38612d
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/components/Card.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
background-color: var(--color-bg-1);
border: 1px solid gray;
min-width: 20rem;
box-shadow: var(--shadow-1);

& .response {
display: grid;
Expand Down
2 changes: 1 addition & 1 deletion src/db/space.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export function createSpace(name: string): Space {
const space: Space = {
version: projectVersion(),
id: createUUID(),
name,
name: name.trim(),
createdTimestamp: timestampNow(),
cards: {},
}
Expand Down
2 changes: 2 additions & 0 deletions src/design-system.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@

--color-bg-1: white;
--color-bg-2: #EEE;

--shadow-1: 0 3px 16px #0004;
}
14 changes: 12 additions & 2 deletions src/routes/space/[id].module.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
grid-area: main;
display: flex;
flex-direction: column;
margin: var(--space-4);
padding: var(--space-4);
overflow: hidden;
}

.main-top-bar {
Expand All @@ -29,7 +30,7 @@
margin-inline-end: 0;
border-radius: var(--space-4);
min-height: 10rem;
box-shadow: 0 2px 16px #0002;
box-shadow: var(--shadow-1);
}

.my-cards-list {
Expand All @@ -52,6 +53,7 @@
text-align: center;
line-height: 1;
height: 1em;
min-width: 0;
}

.deck {
Expand Down Expand Up @@ -104,6 +106,10 @@
grid-area: main;
place-self: flex-end;
color: gray;

&::before {
content: 'version ';
}
}

@media (max-width: 900px) {
Expand Down Expand Up @@ -131,4 +137,8 @@
flex: unset;
overflow-y: unset;
}

.project-version::before {
content: 'v';
}
}
15 changes: 11 additions & 4 deletions src/routes/space/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,19 @@ function SpaceName() {
ref={autofocusFix}
class={ui.spaceName}
value={space.name}
onInput={ev => setSpace('name', ev.currentTarget.value)}
onChange={() => setEditingSpaceName(false)}
onChange={ev => {
setSpace('name', ev.currentTarget.value.trim())
setEditingSpaceName(false)
}}
onBlur={() => setEditingSpaceName(false)}
/>
}>
<h1 class={ui.spaceName} title='Space name' onDblClick={() => setEditingSpaceName(true)}>{space.name}</h1>
<h1
class={ui.spaceName}
title='Space name'
onClick={() => setEditingSpaceName(true)}>
{space.name}
</h1>
</Show>
)
}
Expand Down Expand Up @@ -156,7 +163,7 @@ export default function SpaceComponent() {
</div>
<Deck adding={adding()} setAdding={setAdding} />
<CardControls adding={adding()} setAdding={setAdding} />
<span class={ui.projectVersion}>version {projectVersion()}</span>
<span class={ui.projectVersion}>{projectVersion()}</span>
</div>
</main>
</SpaceContext.Provider>
Expand Down

1 comment on commit c38612d

@vercel
Copy link

@vercel vercel bot commented on c38612d Dec 30, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

space-dex – ./

space-dex-git-main-deluksic.vercel.app
space-dex-deluksic.vercel.app
space-dex.vercel.app

Please sign in to comment.