Remove supply events and weekly boss info from top
This commit is contained in:
@@ -1,17 +1,13 @@
|
|||||||
/** @jsxImportSource theme-ui */
|
/** @jsxImportSource theme-ui */
|
||||||
import { Box, Flex, Heading, Link, Text, Paragraph } from '@theme-ui/components'
|
import { Box, Heading, Link, Paragraph } from '@theme-ui/components'
|
||||||
import NextLink from 'next/link'
|
import NextLink from 'next/link'
|
||||||
import SquareImageBox from '../../components/atoms/SquareImageBox'
|
|
||||||
import Breadcrumb from '../../components/organisms/Breadcrumb'
|
import Breadcrumb from '../../components/organisms/Breadcrumb'
|
||||||
import GanttChart from '../../components/organisms/GanttChart'
|
|
||||||
import { getBattlesuitById } from '../../server/data/honkai3rd/battlesuits'
|
import { getBattlesuitById } from '../../server/data/honkai3rd/battlesuits'
|
||||||
import {
|
import {
|
||||||
getCurrentVersion,
|
getCurrentVersion,
|
||||||
listVersionData,
|
listVersionData,
|
||||||
} from '../../server/data/honkai3rd/versions'
|
} from '../../server/data/honkai3rd/versions'
|
||||||
import { getWeaponById } from '../../server/data/honkai3rd/weapons'
|
import { getWeaponById } from '../../server/data/honkai3rd/weapons'
|
||||||
import { addDateToDateString, getDateString } from '../../lib/string'
|
|
||||||
import ScrollContainer from 'react-indiana-drag-scroll'
|
|
||||||
import { format as formatDate } from 'date-fns'
|
import { format as formatDate } from 'date-fns'
|
||||||
import { BattlesuitData } from '../../lib/honkai3rd/battlesuits'
|
import { BattlesuitData } from '../../lib/honkai3rd/battlesuits'
|
||||||
import { WeaponData } from '../../lib/honkai3rd/weapons'
|
import { WeaponData } from '../../lib/honkai3rd/weapons'
|
||||||
@@ -21,12 +17,9 @@ import { NextPageContext } from 'next'
|
|||||||
import { useTranslation } from '../../lib/i18n'
|
import { useTranslation } from '../../lib/i18n'
|
||||||
import Head from '../../components/atoms/Head'
|
import Head from '../../components/atoms/Head'
|
||||||
import PageLink from '../../components/atoms/PageLink'
|
import PageLink from '../../components/atoms/PageLink'
|
||||||
import { assetsBucketBaseUrl } from '../../lib/consts'
|
|
||||||
import Honkai3rdLayout from '../../components/layouts/Honkai3rdLayout'
|
import Honkai3rdLayout from '../../components/layouts/Honkai3rdLayout'
|
||||||
import WeaponCard from '../../components/molecules/WeaponCard'
|
import WeaponCard from '../../components/molecules/WeaponCard'
|
||||||
import BattlesuitCard from '../../components/molecules/BattlesuitCard'
|
import BattlesuitCard from '../../components/molecules/BattlesuitCard'
|
||||||
import { useCallback, useEffect, useRef, useState } from 'react'
|
|
||||||
import BossTable from '../../components/organisms/BossTable'
|
|
||||||
import { getStigmataSetBySetId } from '../../server/data/honkai3rd/stigmata'
|
import { getStigmataSetBySetId } from '../../server/data/honkai3rd/stigmata'
|
||||||
import { StigmataSet } from '../../lib/honkai3rd/stigmata'
|
import { StigmataSet } from '../../lib/honkai3rd/stigmata'
|
||||||
import StigmataSetCard from '../../components/molecules/StigmataSetCard'
|
import StigmataSetCard from '../../components/molecules/StigmataSetCard'
|
||||||
@@ -47,18 +40,6 @@ const VersionIndexPage = ({
|
|||||||
currentVersionNewStigmataSets,
|
currentVersionNewStigmataSets,
|
||||||
}: VersionIndexPageProps) => {
|
}: VersionIndexPageProps) => {
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
const [today, setToday] = useState<Date | null>(null)
|
|
||||||
const supplyGanttChartScrollContainerRef = useRef<HTMLElement>(null)
|
|
||||||
useEffect(() => {
|
|
||||||
setToday(new Date(getDateString(new Date())))
|
|
||||||
}, [])
|
|
||||||
|
|
||||||
const scrollSupplyGanttChart = useCallback((to: number) => {
|
|
||||||
if (supplyGanttChartScrollContainerRef.current == null) {
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
supplyGanttChartScrollContainerRef.current.scrollTo(to, 0)
|
|
||||||
}, [])
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Honkai3rdLayout>
|
<Honkai3rdLayout>
|
||||||
@@ -143,65 +124,14 @@ const VersionIndexPage = ({
|
|||||||
</Box>
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
<Heading as='h3' mb={2}>
|
<Paragraph>
|
||||||
{t('versions.weekly-bosses')}
|
We've decided to stop providing weekly bossses and supply
|
||||||
</Heading>
|
events since v6.2. But you can still find it from{' '}
|
||||||
|
<a href='https://www.arustats.com/en-us/hi3/timeline'>
|
||||||
<Box sx={{ mb: 3 }}>
|
CAPTAIN ALPACA's Website
|
||||||
<BossTable versionData={currentVersionData} today={today} />
|
</a>
|
||||||
</Box>
|
.
|
||||||
|
</Paragraph>
|
||||||
<Heading as='h3' mb={2}>
|
|
||||||
{t('versions.supply-events')}
|
|
||||||
</Heading>
|
|
||||||
<Box mb={2}>
|
|
||||||
<ScrollContainer
|
|
||||||
vertical={false}
|
|
||||||
innerRef={supplyGanttChartScrollContainerRef}
|
|
||||||
>
|
|
||||||
<GanttChart
|
|
||||||
scrollTo={scrollSupplyGanttChart}
|
|
||||||
items={currentVersionData.supplyEvents.map(
|
|
||||||
(supplyEventData) => {
|
|
||||||
const imgSrc = getIconSrcFromItem(
|
|
||||||
supplyEventData.featured[0]
|
|
||||||
)
|
|
||||||
return {
|
|
||||||
id: `${supplyEventData.duration[0]}/${supplyEventData.duration[1]}/${supplyEventData.name}`,
|
|
||||||
label: (
|
|
||||||
<Flex sx={{ alignItems: 'center' }}>
|
|
||||||
{!supplyEventData.verified && (
|
|
||||||
<Text sx={{ flexShrink: 0 }}>❓</Text>
|
|
||||||
)}
|
|
||||||
{imgSrc != null && (
|
|
||||||
<SquareImageBox
|
|
||||||
size={20}
|
|
||||||
src={imgSrc}
|
|
||||||
alt={supplyEventData.featured[0].id}
|
|
||||||
mr={1}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
<Text>{supplyEventData.name}</Text>
|
|
||||||
</Flex>
|
|
||||||
),
|
|
||||||
duration: supplyEventData.duration,
|
|
||||||
row: supplyEventData.track,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)}
|
|
||||||
today={today}
|
|
||||||
startDate={currentVersionData.duration[0]}
|
|
||||||
endDate={
|
|
||||||
currentVersionData.duration[1] != null
|
|
||||||
? currentVersionData.duration[1]
|
|
||||||
: addDateToDateString(currentVersionData.duration[0], {
|
|
||||||
weeks: 6,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</ScrollContainer>
|
|
||||||
</Box>
|
|
||||||
<Paragraph mb={4}>{t('versions.supply-events-disclaimer')}</Paragraph>
|
|
||||||
</Box>
|
</Box>
|
||||||
<Heading as='h2' mb={3}>
|
<Heading as='h2' mb={3}>
|
||||||
{t('versions.all-versions')}
|
{t('versions.all-versions')}
|
||||||
@@ -267,19 +197,3 @@ export async function getStaticProps({ locale }: NextPageContext) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default VersionIndexPage
|
export default VersionIndexPage
|
||||||
|
|
||||||
function getIconSrcFromItem(item: { type: string; id: string }): string | null {
|
|
||||||
switch (item.type) {
|
|
||||||
case 'battlesuit':
|
|
||||||
return `${assetsBucketBaseUrl}/honkai3rd/battlesuits/portrait-${item.id}.png`
|
|
||||||
case 'weapon':
|
|
||||||
return `${assetsBucketBaseUrl}/honkai3rd/weapons/${item.id}.png`
|
|
||||||
case 'stigmata':
|
|
||||||
return `${assetsBucketBaseUrl}/honkai3rd/stigmata/icon-${item.id}.png`
|
|
||||||
case 'elf':
|
|
||||||
return `${assetsBucketBaseUrl}/honkai3rd/elfs/icon-${item.id}.png`
|
|
||||||
case 'outfit':
|
|
||||||
return `${assetsBucketBaseUrl}/honkai3rd/outfits/portrait-${item.id}.webp`
|
|
||||||
}
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user