generated from dev-protocol/clubs-plugin-starter-kit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
96 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -97,3 +97,6 @@ package-lock.json | |
|
||
# vitest output | ||
vitest.config.ts.* | ||
|
||
# astro | ||
.astro |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
<script lang="ts"> | ||
import { onMount } from 'svelte' | ||
import { i18nFactory } from '@devprotocol/clubs-core' | ||
import { onMount } from 'svelte' | ||
import { i18nFactory } from '@devprotocol/clubs-core' | ||
import { Strings } from '../i18n' | ||
import { Strings } from '../i18n' | ||
export let name: string = 'Clubs' | ||
export let name: string = 'Clubs' | ||
const i18nBase = i18nFactory(Strings) | ||
let i18n = i18nBase(['en']) | ||
const i18nBase = i18nFactory(Strings) | ||
let i18n = i18nBase(['en']) | ||
onMount(() => { | ||
i18n = i18nBase(navigator.languages) | ||
}) | ||
onMount(() => { | ||
i18n = i18nBase(navigator.languages) | ||
}) | ||
</script> | ||
|
||
<h2 class="text-center text-xl font-bold lg:text-4xl"> | ||
{i18n('About', [name])} | ||
{i18n('About', [name])} | ||
</h2> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
--- | ||
const { class: className } = Astro.props as { | ||
blur?: boolean | ||
class?: string | ||
blur?: boolean | ||
class?: string | ||
} | ||
--- | ||
|
||
<div class={`rounded-lg p-6 bg-black/5 ${className ? className : ''}`}> | ||
<slot /> | ||
<slot /> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
<script lang="ts"> | ||
let open = false | ||
let open = false | ||
const onClick = () => { | ||
open = !open | ||
} | ||
const onClick = () => { | ||
open = !open | ||
} | ||
</script> | ||
|
||
<!-- svelte-ignore a11y-click-events-have-key-events --> | ||
<section class="cursor-pointer lg:cursor-auto" on:click={onClick}> | ||
<p class={`overflow-hidden text-left lg:text-xl ${open ? '' : 'truncate'}`}> | ||
<slot /> | ||
</p> | ||
<p class={`overflow-hidden text-left lg:text-xl ${open ? '' : 'truncate'}`}> | ||
<slot /> | ||
</p> | ||
</section> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
<script lang="ts"> | ||
import { onMount } from 'svelte' | ||
import { i18nFactory } from '@devprotocol/clubs-core' | ||
import { onMount } from 'svelte' | ||
import { i18nFactory } from '@devprotocol/clubs-core' | ||
import { Strings } from '../i18n' | ||
import { Strings } from '../i18n' | ||
export let hasSingleMembership: boolean = false | ||
export let hasSingleMembership: boolean = false | ||
const i18nBase = i18nFactory(Strings) | ||
let i18n = i18nBase(['en']) | ||
const i18nBase = i18nFactory(Strings) | ||
let i18n = i18nBase(['en']) | ||
onMount(() => { | ||
i18n = i18nBase(navigator.languages) | ||
}) | ||
onMount(() => { | ||
i18n = i18nBase(navigator.languages) | ||
}) | ||
</script> | ||
|
||
<h2 class="text-center text-2xl font-bold lg:text-4xl"> | ||
{i18n(hasSingleMembership ? 'BecomeMember' : 'SelectMembership')} | ||
{i18n(hasSingleMembership ? 'BecomeMember' : 'SelectMembership')} | ||
</h2> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
<script lang="ts"> | ||
export let title: string | ||
export let text: string | ||
export let url: string | ||
export let className: string | undefined = undefined | ||
export let title: string | ||
export let text: string | ||
export let url: string | ||
export let className: string | undefined = undefined | ||
const shareData = { | ||
title, | ||
text, | ||
url, | ||
} | ||
const shareData = { | ||
title, | ||
text, | ||
url, | ||
} | ||
const handleClick = async () => { | ||
try { | ||
await navigator.share(shareData) | ||
} catch (err) { | ||
console.error({ err }) | ||
} | ||
} | ||
const handleClick = async () => { | ||
try { | ||
await navigator.share(shareData) | ||
} catch (err) { | ||
console.error({ err }) | ||
} | ||
} | ||
</script> | ||
|
||
<button on:click={handleClick} class={className ?? ''}><slot /></button> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
<script lang="ts"> | ||
import { onMount } from 'svelte' | ||
import { i18nFactory } from '@devprotocol/clubs-core' | ||
import { onMount } from 'svelte' | ||
import { i18nFactory } from '@devprotocol/clubs-core' | ||
import { Strings } from '../i18n' | ||
import { Strings } from '../i18n' | ||
const i18nBase = i18nFactory(Strings) | ||
let i18n = i18nBase(['en']) | ||
const i18nBase = i18nFactory(Strings) | ||
let i18n = i18nBase(['en']) | ||
onMount(() => { | ||
i18n = i18nBase(navigator.languages) | ||
}) | ||
onMount(() => { | ||
i18n = i18nBase(navigator.languages) | ||
}) | ||
</script> | ||
|
||
<div | ||
class="mx-auto my-8 w-full max-w-2xl rounded-lg bg-black/10 p-6 text-center" | ||
class="mx-auto my-8 w-full max-w-2xl rounded-lg bg-black/10 p-6 text-center" | ||
> | ||
<h2 class="text-xl font-bold lg:text-4xl"> | ||
{i18n('WaitForLaunch')} | ||
</h2> | ||
<h2 class="text-xl font-bold lg:text-4xl"> | ||
{i18n('WaitForLaunch')} | ||
</h2> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
import type { ClubsI18nParts } from '@devprotocol/clubs-core' | ||
|
||
export const Strings = { | ||
SelectMembership: { | ||
en: 'Select a membership', | ||
ja: 'メンバーシップを選択してください', | ||
}, | ||
BecomeMember: { | ||
en: 'Become a member', | ||
ja: 'メンバーになる', | ||
}, | ||
WaitForLaunch: { | ||
en: 'Please wait for the launch', | ||
ja: 'ローンチまでお待ちください', | ||
}, | ||
About: { | ||
en: ([name]) => `About ${name}`, | ||
ja: ([name]) => `${name} について`, | ||
}, | ||
JPY: { | ||
en: 'JPY', | ||
ja: '円', | ||
}, | ||
SelectMembership: { | ||
en: 'Select a membership', | ||
ja: 'メンバーシップを選択してください', | ||
}, | ||
BecomeMember: { | ||
en: 'Become a member', | ||
ja: 'メンバーになる', | ||
}, | ||
WaitForLaunch: { | ||
en: 'Please wait for the launch', | ||
ja: 'ローンチまでお待ちください', | ||
}, | ||
About: { | ||
en: ([name]) => `About ${name}`, | ||
ja: ([name]) => `${name} について`, | ||
}, | ||
JPY: { | ||
en: 'JPY', | ||
ja: '円', | ||
}, | ||
} satisfies ClubsI18nParts |