-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/staging' into devalias/deps-upgr…
…ade-react-scripts
- Loading branch information
Showing
69 changed files
with
1,588 additions
and
368 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import Bugsnag from "@bugsnag/js"; | ||
import firebase from "firebase/app"; | ||
|
||
export interface SetVenueLiveStatusProps { | ||
venueId: string; | ||
isLive: boolean; | ||
onError?: (msg: string) => void; | ||
onFinish?: () => void; | ||
} | ||
|
||
export const setVenueLiveStatus = async ({ | ||
venueId, | ||
isLive, | ||
onError, | ||
onFinish, | ||
}: SetVenueLiveStatusProps): Promise<void | firebase.functions.HttpsCallableResult> => { | ||
const params = { | ||
isLive, | ||
venueId, | ||
}; | ||
|
||
return firebase | ||
.functions() | ||
.httpsCallable("venue-setVenueLiveStatus")(params) | ||
.catch((err) => { | ||
Bugsnag.notify(err, (event) => { | ||
event.addMetadata("context", { | ||
location: "api/venue::setVenueLiveStatus", | ||
venueId, | ||
}); | ||
}); | ||
|
||
if (onError) onError(err); | ||
}) | ||
.finally(onFinish); | ||
}; |
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,38 @@ | ||
import Bugsnag from "@bugsnag/js"; | ||
import firebase from "firebase/app"; | ||
|
||
export interface GetVideoTokenProps { | ||
userId: string; | ||
roomName: string; | ||
onError?: (msg: string) => void; | ||
onFinish?: () => void; | ||
} | ||
|
||
export type VideoToken = string; | ||
|
||
export const getVideoToken = async ({ | ||
userId, | ||
roomName, | ||
onError, | ||
onFinish, | ||
}: GetVideoTokenProps): Promise<void | VideoToken> => { | ||
return firebase | ||
.functions() | ||
.httpsCallable("video-getToken")({ | ||
identity: userId, | ||
room: roomName, | ||
}) | ||
.then<VideoToken>((res) => res.data.token) | ||
.catch((err) => { | ||
Bugsnag.notify(err, (event) => { | ||
event.addMetadata("context", { | ||
location: "api/video::getVideoToken", | ||
userId, | ||
roomName, | ||
}); | ||
}); | ||
|
||
if (onError) onError(err); | ||
}) | ||
.finally(onFinish); | ||
}; |
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 |
---|---|---|
@@ -1 +1,5 @@ | ||
/** | ||
* @deprecated Use named export instead of default export | ||
*/ | ||
export { default } from "./Button"; | ||
export { AppButton as Button } from "./Button"; |
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,108 @@ | ||
@import "scss/constants"; | ||
|
||
$checkbox-diameter: 32px; | ||
|
||
$checkbox-transition: all 200ms $transition-function; | ||
$checkbox-shadow-preset: inset 0 0 0 1px; | ||
|
||
$toggler-width: 56px; | ||
$toggler-height: 30px; | ||
|
||
$toggler-circle-diameter: 26px; | ||
$toggler-circle-spacing: 2px; | ||
|
||
$toggler-circle-moving-delta: $toggler-width - $toggler-circle-diameter - | ||
$toggler-circle-spacing; | ||
|
||
.Checkbox { | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
|
||
position: relative; | ||
|
||
cursor: pointer; | ||
|
||
// unsetting global label styles | ||
margin: 0; | ||
|
||
&__native-input { | ||
&:checked ~ .Checkbox__custom-input { | ||
background-color: $primary; | ||
|
||
.Checkbox__tick-icon { | ||
opacity: 1; | ||
transform: scale(1); | ||
} | ||
|
||
&--toggler { | ||
background-color: $dimmer-primary; | ||
|
||
&::after { | ||
left: $toggler-circle-moving-delta; | ||
|
||
background-color: $primary; | ||
} | ||
} | ||
} | ||
} | ||
|
||
&__custom-input { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
|
||
width: $checkbox-diameter; | ||
height: $checkbox-diameter; | ||
|
||
box-shadow: $checkbox-shadow-preset opaque-white(0.1); | ||
background-color: opaque-white(0.12); | ||
|
||
border-radius: $border-radius--max; | ||
|
||
&:hover { | ||
background-color: opaque-white(0.16); | ||
box-shadow: $checkbox-shadow-preset opaque-white(0.4); | ||
} | ||
|
||
&--toggler { | ||
width: $toggler-width; | ||
height: $toggler-height; | ||
|
||
border-radius: $border-radius--xl; | ||
|
||
&::after { | ||
content: ""; | ||
position: absolute; | ||
|
||
height: $toggler-circle-diameter; | ||
width: $toggler-circle-diameter; | ||
|
||
border-radius: $border-radius--max; | ||
|
||
background-color: opaque-white(0.3); | ||
|
||
left: $toggler-circle-spacing; | ||
top: $toggler-circle-spacing; | ||
|
||
transform: scale(1); | ||
transition: $checkbox-transition; | ||
} | ||
|
||
.Checkbox__tick-icon { | ||
display: none; | ||
} | ||
} | ||
} | ||
|
||
&__tick-icon { | ||
opacity: 0; | ||
transform: scale(0.2); | ||
transition: $checkbox-transition; | ||
} | ||
|
||
&__label { | ||
margin-left: $spacing--md; | ||
font-size: $font-size--md; | ||
} | ||
} |
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,58 @@ | ||
import React, { DetailedHTMLProps, InputHTMLAttributes } from "react"; | ||
import classNames from "classnames"; | ||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; | ||
import { faCheck } from "@fortawesome/free-solid-svg-icons"; | ||
|
||
import "./Checkbox.scss"; | ||
|
||
export interface CheckboxProps | ||
extends DetailedHTMLProps< | ||
InputHTMLAttributes<HTMLInputElement>, | ||
HTMLInputElement | ||
> { | ||
label?: string; | ||
toggler?: boolean; | ||
containerClassName?: string; | ||
labelClassName?: string; | ||
forwardedRef?: ( | ||
value: React.RefObject<HTMLInputElement> | HTMLInputElement | null | ||
) => void; | ||
} | ||
|
||
export const Checkbox: React.FC<CheckboxProps> = ({ | ||
label, | ||
|
||
toggler: isToggler = false, | ||
|
||
containerClassName, | ||
labelClassName, | ||
|
||
forwardedRef, | ||
...extraInputProps | ||
}) => { | ||
const containerClasses = classNames("Checkbox", containerClassName); | ||
const checkboxClasses = classNames("Checkbox__custom-input", { | ||
"Checkbox__custom-input--toggler": isToggler, | ||
}); | ||
const labelClasses = classNames("Checkbox__label", labelClassName); | ||
|
||
return ( | ||
<label className={containerClasses}> | ||
<input | ||
className="Checkbox__native-input" | ||
hidden | ||
type="checkbox" | ||
ref={forwardedRef} | ||
{...extraInputProps} | ||
/> | ||
<div className={checkboxClasses}> | ||
<FontAwesomeIcon | ||
icon={faCheck} | ||
size="sm" | ||
className="Checkbox__tick-icon" | ||
/> | ||
</div> | ||
{label && <div className={labelClasses}>{label}</div>} | ||
</label> | ||
); | ||
}; |
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 @@ | ||
export { Checkbox } from "./Checkbox"; |
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,12 @@ | ||
@import "scss/constants"; | ||
|
||
.PosterCategory { | ||
display: flex; | ||
font-size: $font-size--xs; | ||
color: $white; | ||
padding: $spacing--xs $spacing--sm; | ||
margin: $spacing--xs; | ||
border-radius: $border-radius--lg; | ||
background-color: $primary; | ||
font-weight: $font-weight--500; | ||
} |
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,11 @@ | ||
import React from "react"; | ||
|
||
import "./PosterCategory.scss"; | ||
|
||
export interface PosterCategoryProps { | ||
category: string; | ||
} | ||
|
||
export const PosterCategory: React.FC<PosterCategoryProps> = ({ category }) => ( | ||
<span className="PosterCategory">{category}</span> | ||
); |
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 @@ | ||
export { PosterCategory } from "./PosterCategory"; |
Oops, something went wrong.