Skip to content

Commit

Permalink
🏝️ now with islands
Browse files Browse the repository at this point in the history
  • Loading branch information
olgam4 committed Aug 5, 2022
1 parent 16c31aa commit 58ed652
Show file tree
Hide file tree
Showing 9 changed files with 54 additions and 51 deletions.
File renamed without changes.
File renamed without changes.
21 changes: 21 additions & 0 deletions src/islands/paragraph/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import type { Component } from 'solid-js'
import { useI18n } from '@solid-primitives/i18n'

interface Variables {
[key: string]: string
}

interface Props {
key: string
variable?: Variables
}

const Paragraph: Component<Props> = (props) => {
const [t] = useI18n()
return (

<p>{t(props.key, props.variable)}</p>
)
}

export default Paragraph
21 changes: 0 additions & 21 deletions src/layouts/404.tsx

This file was deleted.

21 changes: 0 additions & 21 deletions src/layouts/name.tsx

This file was deleted.

22 changes: 19 additions & 3 deletions src/routes/[...404].tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
import C404 from '@layouts/404'
import Paragraph from '@islands/paragraph'
import { Provider } from '@locales'
import { Link } from '@solidjs/router'

export default function () {
export default function() {
return (
<Provider>
<C404 />
<Title>404</Title>
<div class="full flex-center flex-col bg-gray-100/75 text-gray-400">
<h1 class="text-4xl font-extrabold">404</h1>
<div class="flex space-x-1 mt-1">
<Paragraph key='hello' />
<div class="pt-1">
<div class="i-carbon-face-dissatisfied-filled h-4 w-4" />
</div>
</div>
<Link href="/" class="flex items-center space-x-1 mt-4 transition hover:(text-gray-400/40)">
<div class="i-carbon-arrow-left h-7 w-7" />
<span class="font-extrabold">
<Paragraph key='goback' />
</span>
</Link>
</div>
</Provider>
)
}
16 changes: 12 additions & 4 deletions src/routes/hi/[...name].tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
import Name from '@layouts/name'
import Paragraph from '@islands/paragraph'
import { Provider } from '@locales'
import { Link, useParams } from '@solidjs/router'

export default function() {
const params = useParams()

export default function () {
return (
<Provider>
<Title>Hi</Title>
<Name />
<Title>Hello World</Title>
<div class="full flex-center flex-col bg-gray-100/75 space-y-2">
<Paragraph key='hello' variable={{ name: params.name }} />
<Link href="/">
<div class="i-carbon-arrow-left h-7 w-7" />
</Link>
</div>
</Provider>
)
}
2 changes: 1 addition & 1 deletion src/routes/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import App from '@layouts/app'
import App from '@islands/app'
import { Provider } from '@locales'

export default function () {
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"paths": {
"@assets/*": ["src/assets/*"],
"@components/*": ["src/components/*"],
"@layouts/*": ["src/layouts/*"],
"@islands/*": ["src/islands/*"],
"@locales": ["src/locales"],
"@pages/*": ["src/pages/*"]
}
Expand Down

1 comment on commit 58ed652

@vercel
Copy link

@vercel vercel bot commented on 58ed652 Aug 5, 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:

bat – ./

bat-olgam4.vercel.app
bat-brown.vercel.app
bat-git-main-olgam4.vercel.app
bat.glo.quebec

Please sign in to comment.