Skip to content

Commit

Permalink
feat: level actions area
Browse files Browse the repository at this point in the history
  • Loading branch information
paring-chan committed Sep 26, 2024
1 parent 3a2738e commit bee585b
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 14 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"server.js"
],
"devDependencies": {
"@adofai-gg/ui": "1.2.0-beta.35",
"@adofai-gg/ui": "1.2.0-beta.37",
"@commitlint/cli": "^18.4.3",
"@commitlint/config-conventional": "^18.4.3",
"@fluent/bundle": "^0.18.0",
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 41 additions & 0 deletions src/lib/components/levelDetail/LevelActionsArea.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<script lang="ts">
import { Button, Translation } from '@adofai-gg/ui'
import type { APILevel } from '~/lib/types'
interface Props {
level: APILevel
}
const { level }: Props = $props()
</script>

<div class="level-actions-area">
{#if level.downloadUrl}
<a href={level.downloadUrl} rel="noreferrer" target="_blank">
<Button size="lg" leftIcon="fileDownload">
<Translation key="level:download" />
</Button>
</a>
{/if}
{#if level.workshopUrl?.trim()}
<a href={level.workshopUrl.trim()} rel="noreferrer" target="_blank">
<Button size="lg" leftIcon="steam" variant="ghost-dark">
<Translation key="level:workshop" />
</Button>
</a>
{/if}
<Button size="lg" leftIcon="heartOutlined" variant="ghost-dark">TODO</Button>
<Button size="lg" variant="ghost-dark">
<Translation key="level:share" />
</Button>
<Button size="lg" variant="ghost-dark">
<Translation key="level:report" />
</Button>
</div>

<style lang="scss">
.level-actions-area {
display: flex;
gap: 8px;
}
</style>
7 changes: 6 additions & 1 deletion src/lib/localization/ko/level.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,9 @@ bpm = BPM
tiles = 타일 수
artists = 아티스트
creators = 레벨 제작자
creators = 레벨 제작자
download = 다운로드
workshop = 창작마당
share = 공유
report = 신고
5 changes: 3 additions & 2 deletions src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import '$lib'
import '@adofai-gg/ui/dist/stylesheets/globals.scss'
import { IconProvider, Nav, Footer, setGlobalContext } from '@adofai-gg/ui'
import { env } from '$env/dynamic/public'
import type { Snippet } from 'svelte'
import { writable } from 'svelte/store'
Expand Down Expand Up @@ -33,8 +34,8 @@
},
urls: {
main: '/',
signIn: '', // TODO
signUp: ''
signIn: `${env.PUBLIC_ACCOUNT_SERVICE_URL}/auth/signin`, // TODO
signUp: `${env.PUBLIC_ACCOUNT_SERVICE_URL}/auth/signup`
}
})
</script>
Expand Down
16 changes: 13 additions & 3 deletions src/routes/levels/[levelId]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import UserListPanel from '~/lib/components/UserListPanel.svelte'
import type { UserListItemModel } from '@adofai-gg/ui'
import { convertUser } from '~/lib/utils/converter'
import LevelActionsArea from '~/lib/components/levelDetail/LevelActionsArea.svelte'
interface Props {
data: PageData
Expand Down Expand Up @@ -41,12 +42,15 @@
<LevelDetailHeader level={data.level} />
<Container topMargin class="grid">
<div class="main-content-area">
<LevelMetadataArea level={data.level} />
<div class="main-upper-container">
<LevelMetadataArea level={data.level} />
<LevelActionsArea level={data.level} />
</div>
</div>
<div class="meta-area">
<LevelTagDisplay level={data.level} />
<UserListPanel items={creators} title="level:artists" />
<UserListPanel items={artists} title="level:creators" />
<UserListPanel items={artists} title="level:artists" />
<UserListPanel items={creators} title="level:creators" />
</div>
</Container>
</div>
Expand Down Expand Up @@ -90,4 +94,10 @@
grid-column: span 3;
}
}
.main-upper-container {
display: flex;
flex-direction: column;
gap: 16px;
}
</style>
2 changes: 0 additions & 2 deletions src/routes/levels/[levelId]/+page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ export const load: PageLoad = async ({ params, fetch }) => {

const data: APILevel = await res.json()

console.log(data)

return {
level: data,
pageTitle: data.title
Expand Down

0 comments on commit bee585b

Please sign in to comment.