Skip to content

Commit

Permalink
Merge pull request #38 from sqrl-planner/develop
Browse files Browse the repository at this point in the history
Format and add workflow
  • Loading branch information
eamonma authored Jun 10, 2022
2 parents a2fbb26 + e4f1ecb commit 302ea23
Show file tree
Hide file tree
Showing 28 changed files with 2,505 additions and 2,600 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/bump.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Bump version
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/github-tag-action@v6.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Create a GitHub release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.tag_version.outputs.new_tag }}
name: Release ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}
273 changes: 135 additions & 138 deletions components/DisclaimerModal.tsx
Original file line number Diff line number Diff line change
@@ -1,155 +1,152 @@
import { ExternalLinkIcon } from "@chakra-ui/icons"
import {
Button,
Checkbox,
Link,
Modal,
ModalBody,
ModalContent,
ModalFooter,
ModalHeader,
ModalOverlay,
Stack,
Text,
UseDisclosureProps,
Button,
Checkbox,
Link,
Modal,
ModalBody,
ModalContent,
ModalFooter,
ModalHeader,
ModalOverlay,
Stack,
Text,
UseDisclosureProps,
} from "@chakra-ui/react"
import React, { Fragment, useState } from "react"

const DisclaimerModal = (props: {
disclosure: UseDisclosureProps
ModalProps: any
disclosure: UseDisclosureProps
ModalProps: any
}) => {
const [checkedItems, setCheckedItems] = useState([false, false])
const [checkedItems, setCheckedItems] = useState([false, false])

const allChecked = checkedItems.every(Boolean)
const isIndeterminate = checkedItems.some(Boolean) && !allChecked
const allChecked = checkedItems.every(Boolean)
const isIndeterminate = checkedItems.some(Boolean) && !allChecked

const { onClose } = props.disclosure
const { onClose } = props.disclosure

return (
<Fragment>
<Modal
closeOnOverlayClick={false}
{...props.ModalProps}
size="xl"
isCentered
return (
<Fragment>
<Modal
closeOnOverlayClick={false}
{...props.ModalProps}
size="xl"
isCentered
>
<ModalOverlay />
<ModalContent>
<ModalHeader>Disclaimers</ModalHeader>
<ModalBody pb={4}>
<Checkbox
isChecked={allChecked}
isIndeterminate={isIndeterminate}
onChange={(e: React.ChangeEvent<any>) =>
setCheckedItems(() => [
e.target.checked,
e.target.checked,
e.target.checked,
])
}
pb={2}
>
<ModalOverlay />
<ModalContent>
<ModalHeader>Disclaimers</ModalHeader>
<ModalBody pb={4}>
<Checkbox
isChecked={allChecked}
isIndeterminate={isIndeterminate}
onChange={(e: React.ChangeEvent<any>) =>
setCheckedItems(() => [
e.target.checked,
e.target.checked,
e.target.checked,
])
}
pb={2}
>
I understand that...
</Checkbox>
<Stack pl={6} mt={1} spacing={1}>
<Checkbox
isChecked={checkedItems[0]}
onChange={(e: React.ChangeEvent<any>) =>
setCheckedItems([
e.target.checked,
checkedItems[1],
checkedItems[2],
])
}
pb={4}
>
The information on ACORN<sup>1</sup>, the
Faculty of Arts & Science timetable<sup>2</sup>,
and the Faculty of Arts & Science calendar
<sup>3</sup> take precedence over any
information presented here.
</Checkbox>
<Checkbox
isChecked={checkedItems[1]}
onChange={(e: React.ChangeEvent<any>) =>
setCheckedItems([
checkedItems[0],
e.target.checked,
checkedItems[2],
])
}
pb={4}
>
Sqrl is not affiliated with the University in
any official capacity.
</Checkbox>
<Checkbox
isChecked={checkedItems[2]}
onChange={(e: React.ChangeEvent<any>) =>
setCheckedItems([
checkedItems[0],
checkedItems[1],
e.target.checked,
])
}
pb={4}
>
Sqrl cannot enrol in courses for you.
</Checkbox>
</Stack>
<Text mt={4}>
<sup>1</sup>
<Link
variant=""
href="https://acorn.utoronto.ca"
isExternal
mr={4}
>
ACORN <ExternalLinkIcon mx="2px" />
</Link>
{/* </Text>
I understand that...
</Checkbox>
<Stack pl={6} mt={1} spacing={1}>
<Checkbox
isChecked={checkedItems[0]}
onChange={(e: React.ChangeEvent<any>) =>
setCheckedItems([
e.target.checked,
checkedItems[1],
checkedItems[2],
])
}
pb={4}
>
The information on ACORN<sup>1</sup>, the Faculty of Arts &
Science timetable<sup>2</sup>, and the Faculty of Arts & Science
calendar
<sup>3</sup> take precedence over any information presented
here.
</Checkbox>
<Checkbox
isChecked={checkedItems[1]}
onChange={(e: React.ChangeEvent<any>) =>
setCheckedItems([
checkedItems[0],
e.target.checked,
checkedItems[2],
])
}
pb={4}
>
Sqrl is not affiliated with the University in any official
capacity.
</Checkbox>
<Checkbox
isChecked={checkedItems[2]}
onChange={(e: React.ChangeEvent<any>) =>
setCheckedItems([
checkedItems[0],
checkedItems[1],
e.target.checked,
])
}
pb={4}
>
Sqrl cannot enrol in courses for you.
</Checkbox>
</Stack>
<Text mt={4}>
<sup>1</sup>
<Link
variant=""
href="https://acorn.utoronto.ca"
isExternal
mr={4}
>
ACORN <ExternalLinkIcon mx="2px" />
</Link>
{/* </Text>
<Text> */}
<sup>2</sup>
<Link
href="https://timetable.iit.artsci.utoronto.ca"
isExternal
mr={4}
>
Timetable <ExternalLinkIcon mx="2px" />
</Link>
{/* </Text>
<sup>2</sup>
<Link
href="https://timetable.iit.artsci.utoronto.ca"
isExternal
mr={4}
>
Timetable <ExternalLinkIcon mx="2px" />
</Link>
{/* </Text>
<Text> */}
<sup>3</sup>
<Link
href="https://artsci.calendar.utoronto.ca/"
isExternal
mr={4}
>
Calendar <ExternalLinkIcon mx="2px" />
</Link>
</Text>
</ModalBody>
<sup>3</sup>
<Link
href="https://artsci.calendar.utoronto.ca/"
isExternal
mr={4}
>
Calendar <ExternalLinkIcon mx="2px" />
</Link>
</Text>
</ModalBody>

<ModalFooter>
<Button
colorScheme="blue"
disabled={!allChecked}
onClick={() => {
localStorage.setItem(
"disclaimed",
JSON.stringify(true)
)
if (onClose) onClose()
}}
>
OK
</Button>
</ModalFooter>
</ModalContent>
</Modal>
</Fragment>
)
<ModalFooter>
<Button
colorScheme="blue"
disabled={!allChecked}
onClick={() => {
localStorage.setItem("disclaimed", JSON.stringify(true))
if (onClose) onClose()
}}
>
OK
</Button>
</ModalFooter>
</ModalContent>
</Modal>
</Fragment>
)
}

export default DisclaimerModal
4 changes: 2 additions & 2 deletions components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const Header = ({ setSidebarOpen }: { setSidebarOpen: any }) => {
m={4}
ml={6}
as="h1"
fontSize={{base:"3xl", md:"4xl"}}
fontSize={{ base: "3xl", md: "4xl" }}
_before={{
content: `"for ${2022}-${2023}"`,
fontSize: "0.65rem",
Expand Down Expand Up @@ -143,7 +143,7 @@ const Header = ({ setSidebarOpen }: { setSidebarOpen: any }) => {
colorScheme="blue"
bg={useColorModeValue("blue.700", "blue.400")}
onClick={onOpenShare}
mr={{base: 2, xl: 6}}
mr={{ base: 2, xl: 6 }}
>
<Icon mr={{ md: 2 }} as={FaShareSquare} />
<chakra.span display={{ base: "none", md: "inline" }}>
Expand Down
Loading

0 comments on commit 302ea23

Please sign in to comment.