diff --git a/src/components/Thread.jsx b/src/components/Thread.jsx index 3150b06..84472ae 100644 --- a/src/components/Thread.jsx +++ b/src/components/Thread.jsx @@ -14,6 +14,8 @@ import { MenuItem, Tag, HStack, + Grid, + Portal, } from '@chakra-ui/react'; import { useNavigate } from 'react-router-dom'; import ThreadList from './ThreadList'; @@ -51,252 +53,250 @@ function Thread() { }; return ( - + - - - - + + + + + THREAD FORUM + + + + } + size="lg" + onClick={() => navigate('/create-thread')} + whileHover={{ + scale: 1.05, + boxShadow: '0 0 25px rgba(236, 72, 153, 0.5)', + }} + whileTap={{ scale: 0.95 }} + borderRadius="2xl" + px={8} + py={6} bgGradient={`linear(to-r, ${accentColor}, purple.400)`} - bgClip="text" + _hover={{ + bgGradient: 'linear(to-r, pink.500, purple.500)', + }} + boxShadow="0 0 30px rgba(236, 72, 153, 0.3)" + border="1px solid rgba(255, 255, 255, 0.1)" + fontSize="lg" + fontWeight="bold" > - THREAD FORUM - + 新規スレッド作成 + - } - colorScheme="pink" - size="md" - onClick={() => navigate('/create-thread')} - whileHover={{ scale: 1.05 }} - whileTap={{ scale: 0.95 }} - borderRadius="lg" - bgGradient={`linear(to-r, ${accentColor}, purple.400)`} - _hover={{ - bgGradient: 'linear(to-r, pink.500, purple.500)', - }} - > - 新規スレッド作成 - - + + + + + + + - - - - - - - + + {({ isOpen }) => ( + <> + + } + bg="rgba(255, 255, 255, 0.06)" + color="white" + _hover={{ bg: 'rgba(255, 255, 255, 0.08)' }} + _active={{ bg: 'rgba(255, 255, 255, 0.1)' }} + borderRadius="2xl" + px={8} + h="60px" + fontSize="lg" + transition="all 0.3s" + border="1px solid rgba(255, 255, 255, 0.1)" + zIndex={10} + > + + {sortBy === 'newest' ? ( + + ) : sortBy === 'popular' ? ( + + ) : sortBy === 'commentCount' ? ( // 修正箇所 + + ) : null} + + {sortBy === 'newest' + ? '最新順' + : sortBy === 'popular' + ? '人気順' + : sortBy === 'commentCount' // 修正箇所 + ? 'コメント数順' + : ''} + + + + + + {[ + { value: 'newest', icon: TimeIcon, label: '最新順' }, + { value: 'popular', icon: StarIcon, label: '人気順' }, + { + value: 'commentCount', + icon: ChatIcon, + label: 'コメント数順', + }, + ].map(({ value, icon: Icon, label }) => ( + handleSortChange(value)} + > + + + + {label} + + {sortBy === value && ( + + )} + + + ))} + + + + )} + + - - {({ isOpen }) => ( - <> - + + {['すべて', '議論', '質問', '雑談', '趣味', '技術'].map( + (tag, index) => ( + - - - {sortBy === 'newest' - ? '最新順' - : sortBy === 'popular' - ? '人気順' - : 'コメント数順'} - + {tag === 'すべて' && ( + + )} + {tag} - - - handleSortChange('newest')} - > - - - - 最新順 - - {sortBy === 'newest' && } - - - handleSortChange('popular')} - > - - - - 人気順 - - {sortBy === 'popular' && ( - - )} - - - handleSortChange('commentCount')} - > - - - - コメント数順 - - {sortBy === 'commentCount' && ( - - )} - - - - + + ) )} - - - - - - - {['すべて', '議論', '質問', '雑談', '趣味', '技術'].map( - (tag, index) => ( - - - {tag === 'すべて' && } - {tag} - - - ) - )} - - +