Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
shiyiya committed Aug 9, 2024
1 parent bf49b14 commit d637540
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/index/src/components/rank-list/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,27 @@ import { Link } from 'wouter'
import './index.scss'
import { useEffect, useState } from 'react'
import { corsAxios } from '@web/shared/constants'
import classNames from 'classnames'
import { clicliAdapter } from '../../enime.adp'

export default function RankList() {
const [day, setDay] = useState(30)
const [list, setList] = useState<R.Post[]>()

useEffect(() => {
corsAxios.get(`https://www.clicli.cc/rank?day=${day}`).then((rsp) => {
setList(rsp.posts)
setList(clicliAdapter(rsp.posts))
})
}, [day])

return (
<div className="rank-video-list">
<div style={{ marginBottom: '6px' }}>
<div className="tags" style={{ marginBottom: '6px' }}>
{[7, 30, 120, 365].map((n) => (
<span
className={'tag is-hoverable' + (day == n && ' is-primary')}
className={classNames('tag is-hoverable', {
'is-primary': day == n,
})}
onClick={() => {
setDay(n)
}}
Expand Down

0 comments on commit d637540

Please sign in to comment.