11import { Link } from '../../core/SnsLink'
22import React from 'react'
3- import styled from 'styled-components'
3+ import styled , { useTheme } from 'styled-components'
44import { ISponsorLevelItem , ISponsorList } from '../../../interfaces/ISponsor'
55import { useTranslation } from 'react-i18next'
66import { Heading3 } from '../../../assets/styles/typo'
@@ -22,6 +22,7 @@ const SponsorGroup = styled.ul`
2222`
2323
2424const SponsorItem = styled . li `
25+ background: ${ ( props ) => props . color ?? props . theme . colors . white } ;
2526 max-width: 200px;
2627 height: 200px;
2728 list-style: none;
@@ -37,7 +38,9 @@ const SponsorImage = styled.img`
3738
3839const SponsorList = ( props : { list : ISponsorList } ) => {
3940 const { t } = useTranslation ( )
41+ const theme = useTheme ( )
4042 const sponsorList : { [ key : string ] : ISponsorLevelItem } = { }
43+ const blackBackgroundId = [ 3 ]
4144
4245 props . list . list . forEach ( ( sponsor ) => {
4346 const key = `LEVEL_${ sponsor . level } `
@@ -51,6 +54,13 @@ const SponsorList = (props: { list: ISponsorList }) => {
5154 sponsorList [ key ] . list . push ( sponsor )
5255 } )
5356
57+ const backgroundColor = ( id : number ) : string => {
58+ if ( blackBackgroundId . includes ( id ) ) {
59+ return theme . colors . black
60+ }
61+ return theme . colors . white
62+ }
63+
5464 return (
5565 < >
5666 { Object . keys ( sponsorList )
@@ -62,7 +72,10 @@ const SponsorList = (props: { list: ISponsorList }) => {
6272 < Heading3 useGradient = { true } > { item . name } </ Heading3 >
6373 < SponsorGroup >
6474 { item . list . map ( ( sponsor ) => (
65- < SponsorItem key = { sponsor . slug } >
75+ < SponsorItem
76+ key = { sponsor . slug }
77+ color = { backgroundColor ( sponsor . id ) }
78+ >
6679 < Link
6780 href = { `/sponsor/list/${ sponsor . id } ` }
6881 >
0 commit comments