Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update version to 1.2.18: Add unit & rank up & equipment #79

Merged
merged 11 commits into from
Dec 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ description: 'setup node and node_modules'
runs:
using: 'composite'
steps:
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
- name: Setup
run: npm ci --no-audit --progress=false --silent
shell: bash
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Lint
run: npm run lint

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Test
run: CI=true npm test
6 changes: 3 additions & 3 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ jobs:
deploy-gh-pages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20

- name: Get npm cache directory
id: npm-cache-dir
Expand Down
86 changes: 43 additions & 43 deletions package-lock.json

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

16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "last-origin-unit-viewer",
"version": "1.2.17",
"version": "1.2.18",
"private": true,
"license": "UNLICENSED",
"author": "harry0000 <https://github.com/harry0000>",
Expand Down Expand Up @@ -41,14 +41,14 @@
"dependencies": {
"@emotion/react": "^11.11.1",
"@types/gtag.js": "^0.0.18",
"@types/node": "^18.18.12",
"@types/node": "^20.10.4",
"@types/react": "^18.2.38",
"@types/react-dom": "^18.2.17",
"@types/react-router-dom": "^5.3.3",
"@types/recoil": "0.0.9",
"bootstrap": "^4.6.2",
"fast-deep-equal": "^3.1.3",
"i18next": "^22.5.1",
"i18next": "^23.7.8",
"rdndmb-html5-to-touch": "^8.0.3",
"react": "^18.2.0",
"react-bootstrap": "^1.6.7",
Expand All @@ -58,7 +58,7 @@
"react-dnd-preview": "^8.0.3",
"react-dnd-touch-backend": "^16.0.1",
"react-dom": "^18.2.0",
"react-i18next": "^12.3.1",
"react-i18next": "^13.5.0",
"react-router-dom": "^5.3.4",
"react-scripts": "^5.0.1",
"react-virtuoso": "^4.6.2",
Expand All @@ -69,15 +69,15 @@
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^14.1.2",
"@testing-library/user-event": "^14.5.1",
"@types/jest": "^29.5.10",
"@types/jest": "^29.5.11",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"eslint": "^8.54.0",
"eslint": "^8.55.0",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"typescript": "^5.3.2"
"typescript": "^5.3.3"
},
"overrides": {
"typescript": "^5.3.2"
"typescript": "^5.3.3"
}
}
Binary file added public/equip_icon/gear_boiling_vessel_ss.webp
Binary file not shown.
Binary file added public/equip_icon/gear_prototype_warhead_ss.webp
Binary file not shown.
Binary file added public/unit_icon/302.webp
Binary file not shown.
16 changes: 8 additions & 8 deletions src/component/skill/SkillEffectConditionView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/** @jsx jsx */
import { jsx } from '@emotion/react';
import React, { ReactNode } from 'react';
import { StringMap, TFunction } from 'i18next';
import { TFunction } from 'i18next';
import { useTranslation } from 'react-i18next';

import SkillEffectTargetView from './SkillEffectTargetView';
Expand Down Expand Up @@ -109,7 +109,7 @@ function stateValuesView(
const isMultipleTag = isReadonlyArray(tag);
const prefix = isMultipleTag ? 'tags_' : 'tag_';
const suffix = 'greater_or_equal' in entry[1] ? 'stack_ge' : 'stack_le';
const options: StringMap = {
const options = {
...entry[1],
...(isMultipleTag ?
{ tags: tag.map(tagKey => t('effect:tag.format', { tag: tagKey })).join(t('effect:or_symbolic_separator')) }:
Expand Down Expand Up @@ -158,7 +158,7 @@ function affectedByStateView(
} else {
if ('effect' in state) {
const key = 'unit' in state ? 'affected_effect_by' : 'affected_equipment_effect_by';
return (<span>{t(`effect:condition.state.${key}`, state as StringMap)}</span>);
return (<span>{t(`effect:condition.state.${key}`, state)}</span>);
} else {
return (<span>{t('effect:condition.state.affected_by', state)}</span>);
}
Expand Down Expand Up @@ -403,8 +403,8 @@ const SquadStateView: React.FC<{
'equal' in squadState ?
t('effect:condition.state.num_of_units_eq', squadState) :
'greater_or_equal' in squadState ?
t('effect:condition.state.num_of_units_ge', squadState as StringMap) :
t('effect:condition.state.num_of_units_le', squadState as StringMap)
t('effect:condition.state.num_of_units_ge', squadState) :
t('effect:condition.state.num_of_units_le', squadState)
}
<Separator />
</React.Fragment>
Expand Down Expand Up @@ -450,9 +450,9 @@ const EnemyStateView: React.FC<{
t('effect:condition.state.num_of_enemies_eq', num_of_units) :
'less_or_equal' in num_of_units ?
'greater_or_equal' in num_of_units ?
t('effect:condition.state.num_of_enemies', num_of_units as StringMap) :
t('effect:condition.state.num_of_enemies_le', num_of_units as StringMap) :
t('effect:condition.state.num_of_enemies_ge', num_of_units as StringMap)
t('effect:condition.state.num_of_enemies', num_of_units) :
t('effect:condition.state.num_of_enemies_le', num_of_units) :
t('effect:condition.state.num_of_enemies_ge', num_of_units)
}
</React.Fragment>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
/** @jsx jsx */
import { jsx } from '@emotion/react';
import React, { ReactElement } from 'react';
import { StringMap } from 'i18next';
import { useTranslation } from 'react-i18next';
import { nanoid } from 'nanoid';

Expand Down Expand Up @@ -126,7 +125,7 @@ const EffectDetails: React.FC<{ effect: SquadUnitApplyingEffectViewModel }> = ({
const translateAddition = (addition: SquadUnitApplyingEffectViewModel['additions'][number]): string => {
switch (addition.type) {
case 'rate':
return t(`status.effect.rate.${addition.key}`, addition.options as StringMap);
return t(`status.effect.rate.${addition.key}`, addition.options);
case 'times':
return t('effect:times', { count: addition.value });
case 'cannot_be_dispelled':
Expand Down Expand Up @@ -157,7 +156,7 @@ const EffectDetails: React.FC<{ effect: SquadUnitApplyingEffectViewModel }> = ({
const EffectTerm: React.FC<{ effect: SquadUnitApplyingEffectViewModel }> = ({ effect: { term } }) => {
const { t } = useTranslation();

return (<div className="effect-term">{term ? t(term.key, term.options as StringMap) : ''}</div>);
return (<div className="effect-term">{term ? t(term.key, term.options) : ''}</div>);
};

const EffectSource: React.FC<{ effect: SquadUnitApplyingEffectViewModel }> = ({ effect: { type, affected } }) => {
Expand Down
Loading