forked from outloudvi/info-pride
-
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
41 changed files
with
538 additions
and
116 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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Validate locale | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
check_locale: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install dependencies | ||
run: | | ||
sudo apt install -y lua5.3 | ||
sudo npm install -g pnpm | ||
pnpm install | ||
- name: Build & Validate | ||
run: node scripts/check-locale.mjs |
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,17 +1,20 @@ | ||
type ExternalBilibiliVideo = { | ||
type: 'bilibili' | ||
export type ExternalVideo = { | ||
type: 'bilibili' | 'youtube' | ||
vid: string | ||
// Bilibili only | ||
pid?: number | ||
} | ||
|
||
export type ExternalVideo = ExternalBilibiliVideo | ||
|
||
export function toVideoLink(e: ExternalVideo) { | ||
export function toVideoLink(e: ExternalVideo): string { | ||
switch (e.type) { | ||
case 'bilibili': { | ||
return `https://www.bilibili.com/video/${e.vid}${ | ||
e.pid ? `?p=${e.pid}` : '' | ||
}` | ||
} | ||
case 'youtube': { | ||
return `https://www.youtube.com/watch?v=${e.vid}` | ||
} | ||
} | ||
return '' | ||
} |
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
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { AttributeType } from 'hoshimi-types/ProtoEnum' | ||
import { useTranslations } from 'next-intl' | ||
|
||
import getCardColorClassName from '#utils/getCardColorClassName' | ||
|
||
function formatNumber(n: number) { | ||
// add commas to number | ||
return n.toLocaleString('en-US') | ||
} | ||
|
||
const PropValueBg = ({ | ||
type, | ||
bold, | ||
value, | ||
}: { | ||
type: AttributeType | 'stamina' | ||
bold: boolean | ||
value: number | ||
}) => { | ||
const $v = useTranslations('vendor') | ||
return ( | ||
<span | ||
className={`text-lg px-1 border-solid border-0 border-b-4 rounded ${ | ||
getCardColorClassName(type as AttributeType, 'border-') || | ||
'border-stamina' | ||
} ${bold ? 'font-bold' : ''}${ | ||
// generate their CSS | ||
// eslint-disable-next-line no-constant-condition | ||
0 ? 'border-vocal border-dance border-visual' : '' | ||
}`} | ||
aria-label={$v(AttributeType[type as AttributeType] || 'Stamina')} | ||
> | ||
{formatNumber(value)} | ||
</span> | ||
) | ||
} | ||
|
||
export default PropValueBg |
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
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
Oops, something went wrong.