Skip to content

Commit

Permalink
fix: smaller UI fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
coderbyheart committed Jun 29, 2023
1 parent 977fc9e commit 3e3d771
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 15 deletions.
1 change: 1 addition & 0 deletions pages/styleguide.page.server.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const prerender = (): string[] => ['/styleguide']
12 changes: 12 additions & 0 deletions pages/styleguide.page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Footer } from '#components/Footer.js'
import { Navbar } from '#components/Navbar.js'
import { Provider as AppSettingsProvider } from '#context/AppSettings.js'
import { StyleGuidePage } from '#page/StyleGuide.js'

export const Page = () => (
<AppSettingsProvider>
<Navbar />
<StyleGuidePage />
<Footer />
</AppSettingsProvider>
)
2 changes: 1 addition & 1 deletion src/components/AboutHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const AboutHeader = () => (
class="pt-4 pb-4"
>
<header class="container pt-4 pb-4 text-white">
<div class="row d-flex align-items-center flex-direction-row">
<div class="row d-flex align-items-center flex-row">
<div class="col-12 col-sm-6 col-md-4">
<h1>
<Logo strokeWidth={2} color={'white'} /> hello.nrfcloud.com
Expand Down
4 changes: 2 additions & 2 deletions src/components/Ago.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { formatDistanceToNowStrict } from 'date-fns'
import { UploadCloudIcon } from 'lucide-preact'
import { HistoryIcon } from 'lucide-preact'
import { useEffect, useState } from 'preact/hooks'

export const Ago = ({ date }: { date: Date }) => {
Expand All @@ -17,7 +17,7 @@ export const Ago = ({ date }: { date: Date }) => {

return (
<time dateTime={date.toISOString()} class="text-nowrap">
<UploadCloudIcon strokeWidth={1} size={20} class="me-1" />
<HistoryIcon strokeWidth={1} size={20} class="me-1" />
{relTime}
</time>
)
Expand Down
4 changes: 0 additions & 4 deletions src/components/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
Code2,
Cpu,
Fingerprint,
Home,
Link2Icon,
TerminalSquare,
TrashIcon,
Expand Down Expand Up @@ -42,9 +41,6 @@ const Navigation = () => {
const { fingerprint, clear } = useFingerprint()
return (
<>
<Link href="/">
<Home class="me-1" /> Home
</Link>
{fingerprint !== null && device === undefined && (
<Link
href="/recognizing-fingerprint"
Expand Down
2 changes: 1 addition & 1 deletion src/components/buttons/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export const Button = ({
return (
<button type="button" {...rest} class={buttonStyleClass(rest)} ref={ref}>
<ButtonAngledEffect parentRef={ref} />
<span style={{ position: 'relative', zIndex: 99 }}>{children}</span>
<span style={{ position: 'relative', zIndex: 2 }}>{children}</span>
</button>
)
}
Expand Down
4 changes: 2 additions & 2 deletions src/flows/SolarThingyFlow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export const SolarThingyFlow = () => {
</dt>
<dd
style={{ color: 'var(--color-nordic-sun)' }}
class="d-flex flex-direction-column"
class="d-flex flex-column"
>
{currentGain === undefined && <LoadingIndicator light />}
{currentGain !== undefined && (
Expand All @@ -145,7 +145,7 @@ export const SolarThingyFlow = () => {
</dt>
<dd
style={{ color: 'var(--color-nordic-grass)' }}
class="d-flex flex-direction-column"
class="d-flex flex-column"
>
{currentBattery === undefined && <LoadingIndicator light />}
{currentBattery !== undefined && (
Expand Down
17 changes: 17 additions & 0 deletions src/page/StyleGuide.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { SourceHeader } from '#components/SourceHeader.js'
import { StyleGuide } from '#components/StyleGuide.js'

export const StyleGuidePage = () => (
<main>
<article>
<SourceHeader />
<div class="container mt-4">
<div class="row mt-4">
<div class="col-12">
<StyleGuide />
</div>
</div>
</div>
</article>
</main>
)
2 changes: 0 additions & 2 deletions src/page/ViewSource.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Secondary } from '#components/Buttons.js'
import { SourceHeader } from '#components/SourceHeader.js'
import { StyleGuide } from '#components/StyleGuide.js'
import { useEffect, useState } from 'preact/hooks'
import { QRCodeGenerator } from '../components/QRCodeGenerator.js'

Expand Down Expand Up @@ -41,7 +40,6 @@ export const ViewSource = () => (
.
</p>
</section>
<StyleGuide />
</div>
<div class="col-12 col-lg-6">
<h2>QR codes</h2>
Expand Down
6 changes: 3 additions & 3 deletions static/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ code {
height: 100%;
width: 100%;
background-color: rgba(255, 255, 255, 0.1);
z-index: 44;
z-index: 1;
overflow: hidden;
border-radius: 2px;
}
Expand All @@ -248,7 +248,7 @@ code {
height: 100%;
width: 100%;
background-color: rgba(0, 0, 0, 0.1);
z-index: 44;
z-index: 1;
overflow: hidden;
border-radius: 2px;
}
Expand Down Expand Up @@ -282,7 +282,7 @@ code {
rgba(106, 209, 227, 0.05)
);
animation: loading 1s infinite;
z-index: 45;
z-index: 2;
}

@keyframes loading {
Expand Down

0 comments on commit 3e3d771

Please sign in to comment.