Skip to content
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

MCQ component added and wrote stories for that #1

Merged
merged 7 commits into from
May 16, 2022
Prev Previous commit
Next Next commit
Added ternary operator on the whole grid.col
  • Loading branch information
Sourav12061999 committed May 12, 2022
commit 70d17e0794bda8d6c23e094fc52661b1020b37bf
15 changes: 8 additions & 7 deletions components/MCQ/mcq.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Grid } from "@mantine/core";
export default function MCQ(props: Props) {
const { question, description, required, options, orientation, image, alt } = props;
const [value, setValue] = useState<string>("1");
let span=orientation=="horizontal"?8:3;
let span = orientation == "horizontal" ? 8 : 3;
return (
<Grid>
<Grid.Col span={span}>
Expand All @@ -28,19 +28,20 @@ export default function MCQ(props: Props) {
))}
</RadioGroup>
</Grid.Col>
<Grid.Col span={3}>
{image ? (
{image ? (
<Grid.Col span={3}>
<Image
sx={imageStyles}
radius="md"
radioGroup="Question"
src={image}
alt={alt ? alt : "Image about Question"}
/>
) : (
<></>
)}
</Grid.Col>
</Grid.Col>
) : null}
</Grid>
);
}