Skip to content

Commit

Permalink
chore(frontend): adjust colours, remove unused methods
Browse files Browse the repository at this point in the history
  • Loading branch information
ztdevelops committed Apr 26, 2024
1 parent 17b29f1 commit 5fd964e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 23 deletions.
11 changes: 0 additions & 11 deletions client/src/pages/notes/components/PreMCQ.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,6 @@ const PreMCQ: React.FC<PreMCQProps> = ({
setEditOptions([...editOptions, { option: "", is_correct: false }]);
};

const deleteOption = (optionIndex: number) => {
const updatedOptions = editOptions.filter(
(_, index) => index !== optionIndex
);
setEditOptions(updatedOptions);
};

const addOption = () => {
setEditOptions([...editOptions, { option: "", is_correct: false }]);
};

const deleteOption = (optionIndex: number) => {
const updatedOptions = editOptions.filter(
(_, index) => index !== optionIndex,
Expand Down
22 changes: 10 additions & 12 deletions client/src/pages/viewnotes/components/MCQ.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,49 +77,47 @@ export default function MCQ({ question, options, multiple_answers }: MCQProps) {

return (
<Box
bg="white"
bg="midBlue.500"
p={{ base: 4, sm: 6 }} // Responsive padding
rounded="lg"
shadow="xl"
border="1px"
borderColor="gray.200"
width="full"
mx="auto" // Center the box
>
<Text
fontSize={{ base: "lg", sm: "xl" }} // Responsive font size
fontWeight="bold"
color="blue.800"
color="white"
mb={4}
>
{question}
</Text>
<Text fontSize="md" color="gray.500" mb={4}>
<Text fontSize="md" color="white" mb={4}>
{multiple_answers ? "Select all that apply:" : "Select one:"}
</Text>
<Stack spacing={3}>
{options.map((option, index) => (
<Button
key={index}
onClick={() => toggleOption(option.option)}
variant="outline"
colorScheme="blue"
variant="solid"
colorScheme="white"
bg={
selectedOptions.includes(option.option)
? "blue.800"
: "transparent"
? "white"
: "blue.800"
}
color={
selectedOptions.includes(option.option) ? "white" : "blue.800"
selectedOptions.includes(option.option) ? "blue.800" : "white"
}
justifyContent="flex-start" // Align text to the left
textAlign="left" // Align button text to the left
paddingLeft={4} // Give some padding to the left
height="100%"
_hover={{
bg: selectedOptions.includes(option.option)
? "blue.800"
: "blue.50",
? "gray.100"
: "blue.600",
}}
_focus={{
boxShadow: "outline",
Expand Down

0 comments on commit 5fd964e

Please sign in to comment.