-
Notifications
You must be signed in to change notification settings - Fork 21
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 #221 from hampster2018/mackenziesalinas-week-3-and-4
Mackenziesalinas week 3 and 4
- Loading branch information
Showing
92 changed files
with
14,705 additions
and
21,896 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -0,0 +1,77 @@ | ||
import React, { | ||
JSXElementConstructor, | ||
PropsWithChildren, | ||
useEffect, | ||
useState, | ||
} from 'react'; | ||
|
||
interface Props { | ||
delay?: number; | ||
transitionDuration?: number; | ||
wrapperTag?: JSXElementConstructor<any>; | ||
childTag?: JSXElementConstructor<any>; | ||
className?: string; | ||
childClassName?: string; | ||
visible?: boolean; | ||
onComplete?: () => any; | ||
} | ||
|
||
export default function FadeIn(props: PropsWithChildren<Props>) { | ||
const [maxIsVisible, setMaxIsVisible] = useState(0); | ||
const transitionDuration = | ||
typeof props.transitionDuration === 'number' | ||
? props.transitionDuration | ||
: 400; | ||
const delay = typeof props.delay === 'number' ? props.delay : 50; | ||
const WrapperTag = props.wrapperTag || 'div'; | ||
const ChildTag = props.childTag || 'div'; | ||
const visible = typeof props.visible === 'undefined' ? true : props.visible; | ||
|
||
useEffect(() => { | ||
let count = React.Children.count(props.children); | ||
if (!visible) { | ||
// Animate all children out | ||
count = 0; | ||
} | ||
|
||
if (count == maxIsVisible) { | ||
// We're done updating maxVisible, notify when animation is done | ||
const timeout = setTimeout(() => { | ||
if (props.onComplete) props.onComplete(); | ||
}, transitionDuration); | ||
return () => clearTimeout(timeout); | ||
} | ||
|
||
// Move maxIsVisible toward count | ||
const increment = count > maxIsVisible ? 1 : -1; | ||
const timeout = setTimeout(() => { | ||
setMaxIsVisible(maxIsVisible + increment); | ||
}, delay); | ||
return () => clearTimeout(timeout); | ||
}, [ | ||
React.Children.count(props.children), | ||
delay, | ||
maxIsVisible, | ||
visible, | ||
transitionDuration, | ||
]); | ||
|
||
return ( | ||
<WrapperTag className={props.className}> | ||
{React.Children.map(props.children, (child, i) => { | ||
return ( | ||
<ChildTag | ||
className={props.childClassName} | ||
style={{ | ||
transition: `opacity ${transitionDuration}ms, transform ${transitionDuration}ms`, | ||
transform: maxIsVisible > i ? 'none' : 'translateY(20px)', | ||
opacity: maxIsVisible > i ? 1 : 0, | ||
}} | ||
> | ||
{child} | ||
</ChildTag> | ||
); | ||
})} | ||
</WrapperTag> | ||
); | ||
} |
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,23 @@ | ||
import styled from 'styled-components'; | ||
|
||
export const ItemsContainer = styled.div` | ||
height: 50px; | ||
display: flex; | ||
color: white; | ||
position: relative; | ||
flex-direction: row; | ||
padding: '1rem'; | ||
justify-content: center; | ||
align-items: center; | ||
color: white; | ||
background-color: #222424; | ||
`; | ||
|
||
const height = 'height: calc(100vh - 64px);'; | ||
|
||
export const PageContainer = styled.div.attrs({ | ||
className: 'text-gray-600 body-font flex flex-row', | ||
})` | ||
background-color: #222424; | ||
${height} | ||
`; |
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
13 changes: 0 additions & 13 deletions
13
src/pages/concepts-page/components-manager-page/ConceptsMasteredHeader.tsx
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
src/pages/concepts-page/components-manager-page/FlashCardColumn.tsx
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.