This repository has been archived by the owner on Jan 15, 2024. It is now read-only.
-
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.
Merge pull request #508 from true-runes/development
v17.0.0
- Loading branch information
Showing
6 changed files
with
245 additions
and
54 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
components/common/LinkToResultIllustrationApplications.tsx
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,32 @@ | ||
import type { NextPage } from 'next' | ||
|
||
export const LinkToResultIllustrationApplications: NextPage = () => { | ||
return ( | ||
<> | ||
<div className="bg-white text-black"> | ||
<div className="hero"> | ||
<div className="hero-content text-center"> | ||
<div className="max-w-md"> | ||
<h1 className="text-2xl font-bold pb-10 underline font-zen-old-mincho"> | ||
開票イラスト応募状況 | ||
</h1> | ||
<p className="text-base text-left"> | ||
開票イラストの応募状況を | ||
<a | ||
href="/events-in-event/result-illustration-applications" | ||
target="_blank" | ||
rel="noreferrer" | ||
> | ||
<span className="mx-1 link link-hover underline underline-offset-4 text-blue-500 hover:text-blue-900"> | ||
こちら | ||
</span> | ||
</a> | ||
で公開しております。 | ||
</p> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</> | ||
) | ||
} |
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,39 @@ | ||
{ | ||
"contents": [ | ||
{ | ||
"id": "twet1ufquz93", | ||
"createdAt": "2022-06-11T07:13:10.449Z", | ||
"updatedAt": "2022-06-11T07:13:10.449Z", | ||
"publishedAt": "2022-06-11T07:13:10.449Z", | ||
"revisedAt": "2022-06-11T07:13:10.449Z", | ||
"characterName": "シルビナ" | ||
}, | ||
{ | ||
"id": "fhbl4k21lsck", | ||
"createdAt": "2022-06-05T02:35:52.339Z", | ||
"updatedAt": "2022-06-05T02:35:52.339Z", | ||
"publishedAt": "2022-06-05T02:35:52.339Z", | ||
"revisedAt": "2022-06-05T02:35:52.339Z", | ||
"characterName": "クライブ" | ||
}, | ||
{ | ||
"id": "ykor54w9w", | ||
"createdAt": "2022-06-05T01:48:21.778Z", | ||
"updatedAt": "2022-06-11T06:58:23.237Z", | ||
"publishedAt": "2022-06-05T01:48:21.778Z", | ||
"revisedAt": "2022-06-05T01:48:21.778Z", | ||
"characterName": "スタリオン" | ||
}, | ||
{ | ||
"id": "eizjfdmcu", | ||
"createdAt": "2022-06-05T01:48:36.196Z", | ||
"updatedAt": "2022-06-05T01:48:36.196Z", | ||
"publishedAt": "2022-06-05T01:48:36.196Z", | ||
"revisedAt": "2022-06-05T01:48:36.196Z", | ||
"characterName": "シドニア" | ||
} | ||
], | ||
"totalCount": 6, | ||
"offset": 0, | ||
"limit": 10 | ||
} |
140 changes: 140 additions & 0 deletions
140
pages/events-in-event/result-illustration-applications.tsx
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,140 @@ | ||
import type { NextPage } from 'next' | ||
import Link from 'next/link' | ||
import Image from 'next/image' | ||
import { useState, useEffect } from 'react' | ||
import axios from 'axios' | ||
import { Grid } from 'gridjs-react' | ||
|
||
import HumbergerNavigation from '@/components/humberger-menu/HumbergerNavigation' | ||
import { NavBar } from '@/components/common/NavBar' | ||
import { SiteFooter } from '@/components/common/SiteFooter' | ||
|
||
const ResultIllustrationApplications: NextPage = () => { | ||
const [gridJsData, setGridJsData] = useState([]) | ||
const [nowLoading, setNowLoading] = useState(true) | ||
|
||
const apiUrl = | ||
process.env.NEXT_PUBLIC_RESULT_ILLUSTRATIONS_STATUS_API || | ||
'https://headquarters.suikoden.info/result_illustration_applications' | ||
|
||
useEffect(() => { | ||
setNowLoading(true) | ||
setGridJsData([]) // https://github.com/grid-js/gridjs/issues/227 (効かないおまじない) | ||
|
||
axios | ||
.get(apiUrl) | ||
.then((response) => { | ||
// [['スタリオン'], ['アルベルト']] のような二次元配列の形式にする | ||
const gridJsData = response.data.map((characterName: string) => { | ||
return [characterName] | ||
}) | ||
|
||
setGridJsData(gridJsData) | ||
}) | ||
.catch((error) => { | ||
console.error(error) | ||
}) | ||
.finally(() => { | ||
setNowLoading(false) | ||
}) | ||
}, [apiUrl]) | ||
|
||
return ( | ||
<div className="bg-white text-black"> | ||
<title>開票イラスト応募状況 - 幻水総選挙2022</title> | ||
<div className="right"> | ||
<HumbergerNavigation /> | ||
</div> | ||
|
||
<main id="page-wrap"> | ||
<NavBar /> | ||
|
||
<div className="text-base bg-gray-700 text-white breadcrumbs pl-6 pb-2 sticky top-16 z-50"> | ||
<ul> | ||
<li> | ||
<Link href="/" passHref> | ||
ホーム | ||
</Link> | ||
</li> | ||
<li> | ||
<Link href="/events-in-event" passHref> | ||
総選挙内企画 | ||
</Link> | ||
</li> | ||
<li> | ||
<Link href="/events-in-event/illustrations-with-results" passHref> | ||
開票イラスト | ||
</Link> | ||
</li> | ||
<li>開票イラスト応募状況</li> | ||
</ul> | ||
</div> | ||
|
||
<div className="hero"> | ||
<div className="hero-content text-center"> | ||
<div className="max-w-md"> | ||
<h1 className="text-2xl font-bold pt-6 pb-8 underline font-zen-old-mincho"> | ||
開票イラスト応募状況 | ||
</h1> | ||
|
||
<div className="overflow-x-auto w-full"> | ||
{nowLoading ? ( | ||
<Image | ||
src="/images/spinner.gif" | ||
alt="幻水総選挙スピナー" | ||
width="47" | ||
height="47" | ||
/> | ||
) : ( | ||
<> | ||
<div className="text-center"> | ||
<p> | ||
現時点で1枚以上の開票イラストを受領しましたキャラです。 | ||
</p> | ||
<p>(随時更新)</p> | ||
{/* <p>2022年06月20日 12:34 現在 created_at.latest </p> */} | ||
</div> | ||
|
||
<div className="my-4" /> | ||
|
||
<Grid | ||
data={gridJsData} | ||
columns={[ | ||
{ | ||
name: 'キャラ名', | ||
}, | ||
]} | ||
sort={false} | ||
search={false} | ||
pagination={{ enabled: false }} | ||
style={{ | ||
th: { textAlign: 'center' }, | ||
td: { textAlign: 'center' }, | ||
}} | ||
// https://github.com/grid-js/gridjs/blob/master/src/i18n/en_US.ts | ||
language={{ | ||
search: { placeholder: 'キャラ名を検索' }, | ||
sort: { | ||
sortAsc: '昇順で並び替える', | ||
sortDesc: '降順で並び替える', | ||
}, | ||
loading: '読み込み中…', | ||
noRecordsFound: '見つかりませんでした', | ||
error: 'エラーが発生しました', | ||
}} | ||
/> | ||
</> | ||
)} | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div className="divider" /> | ||
<SiteFooter /> | ||
</main> | ||
</div> | ||
) | ||
} | ||
|
||
export default ResultIllustrationApplications |
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