Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
mebtte committed Oct 7, 2023
1 parent b710aa9 commit 3c41e1a
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 62 deletions.
3 changes: 3 additions & 0 deletions apps/pwa/src/components/error_card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import definition from '@/definition';
import getRandomInteger from '#/utils/generate_random_integer';
import { MdRefresh } from 'react-icons/md';
import { CSSVariable } from '@/global_style';
import upperCaseFirstLetter from '@/style/upper_case_first_letter';

const Style = styled.div`
display: flex;
Expand All @@ -26,6 +27,8 @@ const Style = styled.div`
font-size: 12px;
line-height: 1.5;
text-align: center;
${upperCaseFirstLetter}
}
`;

Expand Down
1 change: 1 addition & 0 deletions apps/pwa/src/i18n/en_us.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,4 +199,5 @@ export default {
music_list_are_added_to_playlist_unsuccessfully:
'playlist has included these music already',
next_music_info: 'next music is %s1',
failed_to_get_musicbill_list: 'failed to get musicbill list',
};
1 change: 1 addition & 0 deletions apps/pwa/src/i18n/zh_hans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ const zhCN: {
music_list_are_added_to_playlist: '%s1 首音乐添加到播放列表',
music_list_are_added_to_playlist_unsuccessfully: '播放列表已包含这些音乐',
next_music_info: '下一首播放 %s1',
failed_to_get_musicbill_list: '获取乐单列表失败',
};

export default zhCN;
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import styled from 'styled-components';
import ErrorCard from '@/components/error_card';
import { RequestStatus } from '@/constants';
import Empty from '@/components/empty';
import { t } from '@/i18n';
import { MusicWithSingerAliases } from '../constants';
import Context from '../context';
import playerEventemitter, {
Expand Down Expand Up @@ -38,15 +39,15 @@ function MusicbillList({ music }: { music: MusicWithSingerAliases }) {
}
return (
<StatusContainer>
<Empty description="请先创建乐单" />
<Empty description={t('empty_musicbill_warning')} />
</StatusContainer>
);
}
if (getMusicbillListStatus === RequestStatus.ERROR) {
return (
<StatusContainer>
<ErrorCard
errorMessage="获取乐单列表失败"
errorMessage={t('failed_to_get_musicbill_list')}
retry={reloadMusicbillList}
/>
</StatusContainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import ErrorCard from '@/components/error_card';
import { RequestStatus } from '@/constants';
import { animated, useTransition } from 'react-spring';
import Button, { Variant } from '@/components/button';
import { t } from '@/i18n';
import Context from '../../context';
import e, { EventType } from '../../eventemitter';
import Musicbill from './musicbill';
Expand Down Expand Up @@ -56,7 +57,7 @@ function MusicbillList() {
variant={Variant.PRIMARY}
onClick={openCreateMusicbillDialog}
>
创建乐单
{t('create_musicbill')}
</Button>
</StatusBox>
);
Expand All @@ -72,7 +73,7 @@ function MusicbillList() {
return (
<StatusBox style={style}>
<ErrorCard
errorMessage="获取乐单列表失败"
errorMessage={t('failed_to_get_musicbill_list')}
retry={reloadMusicbillList}
/>
</StatusBox>
Expand Down
116 changes: 58 additions & 58 deletions design/screenshot.excalidraw

Large diffs are not rendered by default.

Binary file modified docs/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3c41e1a

Please sign in to comment.