-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from Team-ONY/feat/#29_implement_profile_function
feat/#29: 仮のプロフィール画面の実装
- Loading branch information
Showing
11 changed files
with
785 additions
and
1 deletion.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { motion } from 'framer-motion'; | ||
import { PropTypes } from 'prop-types'; | ||
import { Avatar, Text } from '@chakra-ui/react'; | ||
|
||
const HeroCard = ({ user }) => { | ||
const cardVariants = { | ||
hover: { | ||
scale: 1.05, | ||
transition: { duration: 0.2 }, | ||
}, | ||
}; | ||
|
||
HeroCard.propTypes = { | ||
user: PropTypes.object.isRequired, | ||
}; | ||
|
||
return ( | ||
<motion.div | ||
initial={{ opacity: 0, y: 20 }} | ||
animate={{ opacity: 1, y: 0 }} | ||
transition={{ duration: 0.5 }} | ||
whileHover="hover" | ||
variants={cardVariants} | ||
className="hero-card" | ||
> | ||
<Avatar size="2xl" src={user.photoURL || 'defaultPhotoURL'} /> | ||
<Text fontSize="2xl" color="white" fontWeight="bold"> | ||
{user.displayName || 'Anonymous'} | ||
</Text> | ||
<Text color="whiteAlpha.700">{user.email}</Text> | ||
</motion.div> | ||
); | ||
}; | ||
|
||
export default HeroCard; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import { Box, Grid, HStack, Text, Icon, VStack } from '@chakra-ui/react'; | ||
import { motion } from 'framer-motion'; | ||
import { TrophyIcon } from '@heroicons/react/24/outline'; | ||
|
||
import { PropTypes } from 'prop-types'; | ||
|
||
const MotionBox = motion(Box); | ||
|
||
const AchievementBadge = ({ icon: IconComponent, name }) => ( | ||
<VStack | ||
p={4} | ||
spacing={2} | ||
bg="rgba(255, 255, 255, 0.05)" | ||
borderRadius="lg" | ||
_hover={{ | ||
transform: 'scale(1.05)', | ||
transition: 'transform 0.2s', | ||
}} | ||
> | ||
<Icon as={IconComponent} boxSize={6} color="purple.400" /> | ||
<Text color="white" fontSize="sm" textAlign="center"> | ||
{name} | ||
</Text> | ||
</VStack> | ||
); | ||
|
||
AchievementBadge.propTypes = { | ||
icon: PropTypes.elementType.isRequired, | ||
name: PropTypes.string.isRequired, | ||
}; | ||
|
||
const AchievementCard = ({ achievements }) => ( | ||
<MotionBox | ||
initial={{ opacity: 0, y: 20 }} | ||
animate={{ opacity: 1, y: 0 }} | ||
mb={6} | ||
bg="rgba(255, 255, 255, 0.05)" | ||
borderRadius="xl" | ||
p={6} | ||
backdropFilter="blur(10px)" | ||
boxShadow="0 4px 30px rgba(0, 0, 0, 0.1)" | ||
border="1px solid rgba(255, 255, 255, 0.1)" | ||
> | ||
<HStack mb={4}> | ||
<Icon as={TrophyIcon} color="purple.400" boxSize={6} /> | ||
<Text color="white" fontSize="xl" fontWeight="bold"> | ||
アチーブメント | ||
</Text> | ||
</HStack> | ||
<Grid templateColumns="repeat(3, 1fr)" gap={4}> | ||
{achievements.map((achievement) => ( | ||
<AchievementBadge | ||
key={achievement.id} | ||
icon={achievement.icon} | ||
name={achievement.name} | ||
/> | ||
))} | ||
</Grid> | ||
</MotionBox> | ||
); | ||
|
||
AchievementCard.propTypes = { | ||
achievements: PropTypes.array.isRequired, | ||
}; | ||
|
||
export default AchievementCard; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { Box, HStack, Text, Icon } from '@chakra-ui/react'; | ||
import { motion } from 'framer-motion'; | ||
import { HiOutlineStar } from 'react-icons/hi'; | ||
import { PropTypes } from 'prop-types'; | ||
|
||
const MotionBox = motion(Box); | ||
|
||
const HallOfFameCard = ({ post }) => ( | ||
<MotionBox | ||
initial={{ opacity: 0, y: 20 }} | ||
animate={{ opacity: 1, y: 0 }} | ||
mb={6} | ||
bg="rgba(255, 255, 255, 0.05)" | ||
borderRadius="xl" | ||
p={6} | ||
backdropFilter="blur(10px)" | ||
boxShadow="0 4px 30px rgba(0, 0, 0, 0.1)" | ||
border="1px solid rgba(255, 255, 255, 0.1)" | ||
_hover={{ | ||
transform: 'translateY(-5px)', | ||
transition: 'transform 0.2s', | ||
}} | ||
> | ||
<HStack mb={4}> | ||
<Icon as={HiOutlineStar} color="yellow.400" boxSize={6} /> | ||
<Text color="white" fontSize="lg" fontWeight="bold"> | ||
殿堂入り投稿 | ||
</Text> | ||
</HStack> | ||
<Text color="whiteAlpha.800" fontSize="md"> | ||
{post.content} | ||
</Text> | ||
<HStack mt={4} justify="space-between"> | ||
<Text color="whiteAlpha.600" fontSize="sm"> | ||
{new Date(post.createdAt?.toDate()).toLocaleDateString()} | ||
</Text> | ||
<HStack> | ||
<Icon as={HiOutlineStar} color="yellow.400" /> | ||
<Text color="whiteAlpha.800">{post.likes}</Text> | ||
</HStack> | ||
</HStack> | ||
</MotionBox> | ||
); | ||
|
||
HallOfFameCard.propTypes = { | ||
post: PropTypes.object.isRequired, | ||
}; | ||
|
||
export default HallOfFameCard; |
Oops, something went wrong.