Host public assets from AWS
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
/** @jsxImportSource theme-ui */
|
||||
import { Flex, Text } from '@theme-ui/components'
|
||||
import { useRouter } from 'next/router'
|
||||
import { assetsBucketBaseUrl } from '../../lib/consts'
|
||||
import { battlesuitFeatures } from '../../lib/honkai3rd/battlesuits'
|
||||
import { translate } from '../../lib/i18n'
|
||||
import SquareImageBox from './SquareImageBox'
|
||||
@@ -27,7 +28,7 @@ const BattlesuitFeatureLabel = ({ feature }: BattlesuitFeatureLabelProps) => {
|
||||
{featureData != null && (
|
||||
<SquareImageBox
|
||||
size={30}
|
||||
src={`/assets/honkai3rd/${icon}.png`}
|
||||
src={`${assetsBucketBaseUrl}/honkai3rd/${icon}.png`}
|
||||
alt={translatedLabel}
|
||||
mr={1}
|
||||
/>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/** @jsxImportSource theme-ui */
|
||||
import { assetsBucketBaseUrl } from '../../lib/consts'
|
||||
import SquareImageBox from './SquareImageBox'
|
||||
|
||||
interface BattlesuitRankIconProps {
|
||||
@@ -27,7 +28,7 @@ const BattlesuitRankIcon = ({
|
||||
return (
|
||||
<SquareImageBox
|
||||
size={size}
|
||||
src={`/assets/honkai3rd/rank-icons/${rank}-rank.png`}
|
||||
src={`${assetsBucketBaseUrl}/honkai3rd/rank-icons/${rank}-rank.png`}
|
||||
alt={`${rank} rank`}
|
||||
m={m}
|
||||
mx={mx}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/** @jsxImportSource theme-ui */
|
||||
import { useRouter } from 'next/router'
|
||||
import { Link, Text } from 'theme-ui'
|
||||
import { assetsBucketBaseUrl } from '../../lib/consts'
|
||||
import SquareImageBox from './SquareImageBox'
|
||||
|
||||
interface FilterButtonProps {
|
||||
@@ -40,7 +41,7 @@ const FilterButton = ({
|
||||
>
|
||||
{icon != null && (
|
||||
<SquareImageBox
|
||||
src={`/assets/honkai3rd/${icon}.png`}
|
||||
src={`${assetsBucketBaseUrl}/honkai3rd/${icon}.png`}
|
||||
alt={label}
|
||||
size={30}
|
||||
mr={1}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
/** @jsxImportSource theme-ui */
|
||||
import { Box } from '@theme-ui/components'
|
||||
import Image from 'next/image'
|
||||
import { Box, Image } from '@theme-ui/components'
|
||||
|
||||
interface SquareImageBoxProps {
|
||||
size: number | string | Array<number | string>
|
||||
@@ -45,7 +44,7 @@ const SquareImageBox = ({
|
||||
flexShrink: 0,
|
||||
}}
|
||||
>
|
||||
<Image alt={alt} layout='fill' objectFit='cover' src={src} />
|
||||
<Image alt={alt} src={src} />
|
||||
</Box>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/** @jsxImportSource theme-ui */
|
||||
import { Flex, Text } from '@theme-ui/components'
|
||||
import { useRouter } from 'next/router'
|
||||
import { assetsBucketBaseUrl } from '../../lib/consts'
|
||||
import { battlesuitTypes } from '../../lib/honkai3rd/battlesuits'
|
||||
import { translate } from '../../lib/i18n'
|
||||
import { capitalize } from '../../lib/string'
|
||||
@@ -28,7 +29,7 @@ const TypeLabel = ({ type }: TypeLabelProps) => {
|
||||
{isValidType(type) && (
|
||||
<SquareImageBox
|
||||
size={30}
|
||||
src={`/assets/honkai3rd/type-icons/${type}.png`}
|
||||
src={`${assetsBucketBaseUrl}/honkai3rd/type-icons/${type}.png`}
|
||||
alt={label}
|
||||
mr={1}
|
||||
/>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/** @jsxImportSource theme-ui */
|
||||
import { Flex, Text } from '@theme-ui/components'
|
||||
import { useRouter } from 'next/router'
|
||||
import { assetsBucketBaseUrl } from '../../lib/consts'
|
||||
import { valkyries } from '../../lib/honkai3rd/battlesuits'
|
||||
import { translate } from '../../lib/i18n'
|
||||
import SquareImageBox from './SquareImageBox'
|
||||
@@ -22,7 +23,7 @@ const ValkyrieLabel = ({ valkyrie }: ValkyrieLabelProps) => {
|
||||
{icon && (
|
||||
<SquareImageBox
|
||||
size={30}
|
||||
src={`/assets/honkai3rd/${icon}.png`}
|
||||
src={`${assetsBucketBaseUrl}/honkai3rd/${icon}.png`}
|
||||
alt={translatedLabel}
|
||||
mr={1}
|
||||
/>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/** @jsxImportSource theme-ui */
|
||||
import { Box, Card, Text } from '@theme-ui/components'
|
||||
import { useRouter } from 'next/router'
|
||||
import { assetsBucketBaseUrl } from '../../lib/consts'
|
||||
import { BattlesuitData } from '../../lib/honkai3rd/battlesuits'
|
||||
import { translate } from '../../lib/i18n'
|
||||
import PageLink from '../atoms/PageLink'
|
||||
@@ -38,7 +39,7 @@ const BattlesuitCard = ({ battlesuit, hidden }: BattlesuitCardProps) => {
|
||||
>
|
||||
<SquareImageBox
|
||||
alt={battlesuitName}
|
||||
src={`/assets/honkai3rd/battlesuits/portrait-${battlesuit.id}.png`}
|
||||
src={`${assetsBucketBaseUrl}/honkai3rd/battlesuits/portrait-${battlesuit.id}.png`}
|
||||
size={100}
|
||||
/>
|
||||
<Box
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
import { Box, Card, Text } from '@theme-ui/components'
|
||||
import { useRouter } from 'next/router'
|
||||
import { assetsBucketBaseUrl } from '../../lib/consts'
|
||||
import { ElfData } from '../../lib/honkai3rd/elfs'
|
||||
import { translate } from '../../lib/i18n'
|
||||
import PageLink from '../atoms/PageLink'
|
||||
@@ -30,7 +31,7 @@ const ElfCard = ({ elf }: ElfCardProps) => {
|
||||
<PageLink href={`/honkai3rd/elfs/${elf.id}`}>
|
||||
<SquareImageBox
|
||||
alt={elfName}
|
||||
src={`/assets/honkai3rd/elfs/icon-${elf.id}.png`}
|
||||
src={`${assetsBucketBaseUrl}/honkai3rd/elfs/icon-${elf.id}.png`}
|
||||
size={[100]}
|
||||
/>
|
||||
<Box
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/** @jsxImportSource theme-ui */
|
||||
import { Box, Card, Text } from '@theme-ui/components'
|
||||
import { useRouter } from 'next/router'
|
||||
import { assetsBucketBaseUrl } from '../../lib/consts'
|
||||
import { StigmataData } from '../../lib/honkai3rd/stigmata'
|
||||
import { translate } from '../../lib/i18n'
|
||||
import PageLink from '../atoms/PageLink'
|
||||
@@ -29,7 +30,7 @@ const StigmataCard = ({ stigmata }: StigmataCardProps) => {
|
||||
<SquareImageBox
|
||||
size={[75, 100]}
|
||||
alt={stigmataName}
|
||||
src={`/assets/honkai3rd/stigmata/icon-${stigmata.id}.png`}
|
||||
src={`${assetsBucketBaseUrl}/honkai3rd/stigmata/icon-${stigmata.id}.png`}
|
||||
/>
|
||||
<Box
|
||||
sx={{
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/** @jsxImportSource theme-ui */
|
||||
import { Box, Card, Flex, Text } from '@theme-ui/components'
|
||||
import { useRouter } from 'next/router'
|
||||
import { assetsBucketBaseUrl } from '../../lib/consts'
|
||||
import { StigmataSet } from '../../lib/honkai3rd/stigmata'
|
||||
import { translate } from '../../lib/i18n'
|
||||
import PageLink from '../atoms/PageLink'
|
||||
@@ -31,17 +32,17 @@ const StigmataSetCard = ({ stigmataSet }: StigmataSetCardProps) => {
|
||||
<SquareImageBox
|
||||
size={[80, 100]}
|
||||
alt={`${stigmataSet.id} Top`}
|
||||
src={`/assets/honkai3rd/stigmata/icon-${stigmataSet.id}-top.png`}
|
||||
src={`${assetsBucketBaseUrl}/honkai3rd/stigmata/icon-${stigmataSet.id}-top.png`}
|
||||
/>
|
||||
<SquareImageBox
|
||||
size={[80, 100]}
|
||||
alt={`${stigmataSet.id} Mid`}
|
||||
src={`/assets/honkai3rd/stigmata/icon-${stigmataSet.id}-mid.png`}
|
||||
src={`${assetsBucketBaseUrl}/honkai3rd/stigmata/icon-${stigmataSet.id}-mid.png`}
|
||||
/>
|
||||
<SquareImageBox
|
||||
size={[80, 100]}
|
||||
alt={`${stigmataSet.id} Bottom`}
|
||||
src={`/assets/honkai3rd/stigmata/icon-${stigmataSet.id}-bot.png`}
|
||||
src={`${assetsBucketBaseUrl}/honkai3rd/stigmata/icon-${stigmataSet.id}-bot.png`}
|
||||
/>
|
||||
</Flex>
|
||||
<Box
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/** @jsxImportSource theme-ui */
|
||||
import { Box, Card, Text } from '@theme-ui/components'
|
||||
import { useRouter } from 'next/router'
|
||||
import { assetsBucketBaseUrl } from '../../lib/consts'
|
||||
import { WeaponData } from '../../lib/honkai3rd/weapons'
|
||||
import { translate } from '../../lib/i18n'
|
||||
import PageLink from '../atoms/PageLink'
|
||||
@@ -31,7 +32,7 @@ const WeaponCard = ({ weapon, hidden }: WeaponCardProps) => {
|
||||
<SquareImageBox
|
||||
size={100}
|
||||
alt={weaponName}
|
||||
src={`/assets/honkai3rd/weapons/${weapon.id}.png`}
|
||||
src={`${assetsBucketBaseUrl}/honkai3rd/weapons/${weapon.id}.png`}
|
||||
/>
|
||||
<Box
|
||||
sx={{
|
||||
|
||||
@@ -13,6 +13,7 @@ import {
|
||||
import NextLink from 'next/link'
|
||||
import { useRouter } from 'next/router'
|
||||
import { useCallback, useState } from 'react'
|
||||
import { assetsBucketBaseUrl } from '../../lib/consts'
|
||||
import { useTranslation } from '../../lib/i18n'
|
||||
import PageLink from '../atoms/PageLink'
|
||||
import SquareImageBox from '../atoms/SquareImageBox'
|
||||
@@ -178,7 +179,7 @@ const NavItem = ({ target }: NavItemProps) => {
|
||||
<SquareImageBox
|
||||
size={20}
|
||||
mr={1}
|
||||
src={`/assets/honkai3rd/nav-icons/${target}.png`}
|
||||
src={`${assetsBucketBaseUrl}/honkai3rd/nav-icons/${target}.png`}
|
||||
/>
|
||||
<Text
|
||||
sx={{
|
||||
@@ -225,7 +226,7 @@ const Honkai3rdNavMobileItem = ({
|
||||
<SquareImageBox
|
||||
size={40}
|
||||
mr={1}
|
||||
src={`/assets/honkai3rd/nav-icons/${target}.png`}
|
||||
src={`${assetsBucketBaseUrl}/honkai3rd/nav-icons/${target}.png`}
|
||||
/>
|
||||
<Text
|
||||
sx={{
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
/** @jsxImportSource theme-ui */
|
||||
import { StigmataData, StigmataSet } from '../../lib/honkai3rd/stigmata'
|
||||
import Image from 'next/image'
|
||||
import { Box, Heading, Paragraph, Card, Flex } from '@theme-ui/components'
|
||||
import {
|
||||
Box,
|
||||
Heading,
|
||||
Paragraph,
|
||||
Card,
|
||||
Flex,
|
||||
Image,
|
||||
} from '@theme-ui/components'
|
||||
import PageLink from '../../components/atoms/PageLink'
|
||||
import StigmataCard from '../../components/molecules/StigmataCard'
|
||||
import Breadcrumb from '../../components/organisms/Breadcrumb'
|
||||
@@ -10,6 +16,7 @@ import SecondaryLabel from '../atoms/SecondaryLabel'
|
||||
import { useRouter } from 'next/router'
|
||||
import { translate, useTranslation } from '../../lib/i18n'
|
||||
import Head from '../atoms/Head'
|
||||
import { assetsBucketBaseUrl } from '../../lib/consts'
|
||||
|
||||
export interface SingleStigmataPageProps {
|
||||
type: 'single'
|
||||
@@ -82,10 +89,9 @@ const SingleStigmataPage = ({
|
||||
>
|
||||
<Image
|
||||
alt={stigmataName}
|
||||
src={`/assets/honkai3rd/stigmata/${stigmataData.id}.png`}
|
||||
src={`${assetsBucketBaseUrl}/honkai3rd/stigmata/${stigmataData.id}.png`}
|
||||
width={400}
|
||||
height={400}
|
||||
layout='responsive'
|
||||
/>
|
||||
</Box>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user