-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
React/fix popular radio card #410
Merged
+154
−84
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
bdd0a69
add shuffledRadios in RadioStore
kobakazu0429 ccdefe8
create RadioMiniCard(only: title, thumbnail)
kobakazu0429 dc94d96
apply
kobakazu0429 814ecb7
add RadioMiniCard for storybook
kobakazu0429 8f07968
add snapshots
kobakazu0429 6fa58e3
Merge branch 'feature/react' into react/fix-popular-radio-card
kobakazu0429 bd5ce69
Merge branch feature/react into react/fix-popular-radio-card
kobakazu0429 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
68 changes: 68 additions & 0 deletions
68
frontend/src/components/atoms/PopularRadio/RadioMiniCard.tsx
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,68 @@ | ||
import React from "react"; | ||
import styled from "styled-components"; | ||
|
||
import { color } from "@/constants/styles"; | ||
import { IRadio } from "@/api/RadioApi"; | ||
|
||
type Props = Pick<IRadio, "title" | "image">; | ||
|
||
export const RadioMiniCard: React.FC<Props> = ({ title, image }) => ( | ||
<Wrapper> | ||
<ThumbnailWrapper> | ||
<RadioImg src={image} /> | ||
</ThumbnailWrapper> | ||
<RadioProperties> | ||
<RadioTitle>{title}</RadioTitle> | ||
</RadioProperties> | ||
</Wrapper> | ||
); | ||
|
||
const Wrapper = styled.div` | ||
width: 100%; | ||
height: 75px; | ||
display: flex; | ||
`; | ||
|
||
const ThumbnailWrapper = styled.div` | ||
flex: 0 0 30%; | ||
`; | ||
|
||
const RadioImg = styled.img` | ||
width: 100%; | ||
height: 100%; | ||
object-fit: contain; | ||
`; | ||
|
||
const RadioProperties = styled.div` | ||
flex: 0 0 70%; | ||
`; | ||
|
||
const RadioTitle = styled.span` | ||
color: ${color.ORANGE}; | ||
height: 100%; | ||
display: inline-flex; | ||
justify-content: flex-start; | ||
align-items: center; | ||
font-size: 1rem; | ||
`; | ||
|
||
// NOTE: DON'T REMOVE | ||
// const RadioImg = styled.img` | ||
// width: 120px; | ||
// height: auto; | ||
// align-self: flex-start; | ||
// `; | ||
|
||
// NOTE: DON'T REMOVE | ||
// const RadioTitle = styled.div` | ||
// color: ${color.ORANGE}; | ||
// font-size: 1rem; | ||
// `; | ||
|
||
// NOTE: DON'T REMOVE | ||
// const RadioDescription = styled.p` | ||
// color: ${color.GRAY}; | ||
// font-size: 0.9rem; | ||
// margin-top: 6px; | ||
// text-indent: 0.9rem; | ||
// `; |
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
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 |
---|---|---|
@@ -1,9 +1,12 @@ | ||
import React from "react"; | ||
import { RadioCard } from "@/components/molecules/RadioCard/RadioCard"; | ||
import { ck013 } from "./mocks/api/radio"; | ||
import { RadioCard } from "@/components/molecules/RadioCard/RadioCard"; | ||
import { RadioMiniCard } from "@/components/atoms/PopularRadio/RadioMiniCard"; | ||
|
||
export default { | ||
title: "RadioCard" | ||
}; | ||
|
||
export const normal = () => <RadioCard {...ck013} />; | ||
|
||
export const normalMini = () => <RadioMiniCard {...ck013} />; |
Binary file added
BIN
+16.7 KB
...napshots__/storyshot-test-ts-image-storyshots-radio-card-normal-mini-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
descriptionも表示する時用のcss