-
Notifications
You must be signed in to change notification settings - Fork 593
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
teacher tool: add home screen carousels (#9885)
* tt: home screen carousels * card type * move confirmation * rename handler, remove window origin * callback naming * remove comment * better card typing
- Loading branch information
1 parent
cd8edad
commit 9440155
Showing
16 changed files
with
284 additions
and
18 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -31,6 +31,7 @@ | |
width: 5px; | ||
height: 100%; | ||
cursor: ew-resize; | ||
z-index: 1; | ||
} | ||
|
||
.splitter-vertical-inner:hover { | ||
|
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 was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { useEffect, useState } from "react"; | ||
import { RequestStatus } from "../types"; | ||
import { fetchJsonDocAsync } from "../services/backendRequests"; | ||
|
||
export function useJsonDocRequest<T>( | ||
url: string, | ||
setStatus: (status: RequestStatus) => void, | ||
setJson: (data: T) => void | ||
) { | ||
const [fetching, setFetching] = useState<boolean>(); | ||
|
||
useEffect(() => { | ||
if (!fetching) { | ||
setFetching(true); | ||
setStatus("loading"); | ||
Promise.resolve() | ||
.then(async () => { | ||
const json = await fetchJsonDocAsync(url); | ||
if (!json) { | ||
setStatus("error"); | ||
} else { | ||
setStatus("success"); | ||
setJson(json as T); | ||
} | ||
}) | ||
.catch(() => { | ||
setStatus("error"); | ||
}); | ||
} | ||
}, [fetching]); | ||
} |
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
Oops, something went wrong.