Skip to content
This repository was archived by the owner on Sep 21, 2024. It is now read-only.

Commit

Permalink
Merge pull request #97 from tdu-logcation/fix/versions
Browse files Browse the repository at this point in the history
バージョン表示のバグ修正
  • Loading branch information
cateiru authored Nov 6, 2021
2 parents 8655d5c + 19723b2 commit 2f5e91f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
7 changes: 2 additions & 5 deletions components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import {Box, Text, Center, Flex, Spacer, Link} from '@chakra-ui/react';
import {colors} from '../utils/colors';
import {HiExternalLink} from 'react-icons/hi';
import {v} from '../utils/version';

export const Footer = () => {
return (
Expand All @@ -16,10 +16,7 @@ export const Footer = () => {
<Box>
<Link href="https://github.com/tdu-logcation/web" isExternal>
<Box color={colors('textSecondly')} fontSize=".7rem">
<Flex>
GitHub
<HiExternalLink />
</Flex>
{v}
</Box>
</Link>
</Box>
Expand Down
20 changes: 15 additions & 5 deletions components/Version.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
ModalFooter,
ModalContent,
Link,
Text,
} from '@chakra-ui/react';
import {v} from '../utils/version';
import {version} from '../utils/recoilAtoms';
Expand All @@ -21,7 +22,7 @@ const Version = () => {
const {isOpen, onOpen, onClose} = useDisclosure();

React.useEffect(() => {
if (_version !== v) {
if (_version !== v || v === 'dev') {
// バージョンの更新とモーダル表示
onOpen();
setVersion(v);
Expand All @@ -39,13 +40,22 @@ const Version = () => {
>
<ModalOverlay />
<ModalContent>
<ModalHeader>Logcation 新着情報</ModalHeader>
<ModalHeader>Logcation "{v}" 新着情報</ModalHeader>
<ModalCloseButton size="lg" />
<ModalBody>
詳しくは、
<br />
<Link isExternal>
https://github.com/hello-slide/front/releases/tag{v}/
<Link
isExternal
href={
v !== 'dev'
? `https://github.com/tdu-logcation/web/releases/tag/${v}/`
: 'https://github.com/tdu-logcation/web'
}
_hover={{color: 'blue.300'}}
>
<Text fontWeight="bold" textDecoration="underline" as="span">
リリースノート
</Text>
</Link>
を参照してください。
</ModalBody>
Expand Down
2 changes: 1 addition & 1 deletion utils/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const v = 'v1.0.1';
export const v = 'dev';

0 comments on commit 2f5e91f

Please sign in to comment.