Skip to content

Commit

Permalink
Merge pull request #1889 from sparkletown/mike-lvov/github-deployment
Browse files Browse the repository at this point in the history
deployment master -> env/github
  • Loading branch information
mike-lvov authored Jul 22, 2021
2 parents ba1934e + 5b80a95 commit 3861cb5
Show file tree
Hide file tree
Showing 41 changed files with 475 additions and 426 deletions.
18 changes: 9 additions & 9 deletions functions/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion functions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
"devDependencies": {
"eslint": "^7.19.0",
"eslint-plugin-promise": "^4.0.1",
"eslint-plugin-promise": "^5.1.0",
"firebase-functions-test": "^0.2.3",
"firebase-tools": "^9.2.2",
"prettier": "^2.2.1"
Expand Down
34 changes: 20 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
"@fortawesome/fontawesome-svg-core": "^1.2.32",
"@fortawesome/free-brands-svg-icons": "^5.15.1",
"@fortawesome/free-regular-svg-icons": "^5.15.1",
"@fortawesome/free-solid-svg-icons": "^5.15.1",
"@fortawesome/free-solid-svg-icons": "^5.15.3",
"@fortawesome/react-fontawesome": "^0.1.13",
"@reduxjs/toolkit": "^1.6.0",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.5.0",
"@testing-library/user-event": "^7.2.1",
"@types/mousetrap": "^1.6.4",
"@types/qs": "^6.9.3",
"@types/qs": "^6.9.7",
"@types/react-resize-detector": "^4.2.0",
"@types/styled-components": "^5.1.4",
"@types/ws": "^7.2.6",
Expand All @@ -27,6 +27,7 @@
"date-fns": "^2.22.1",
"dayjs": "^1.8.35",
"emoji-mart": "^3.0.1",
"eslint-plugin-promise": "^5.1.0",
"esm": "^3.2.25",
"firebase": "^7.14.2",
"fuse.js": "^6.4.1",
Expand Down Expand Up @@ -152,7 +153,6 @@
"babel-plugin-lodash": "^3.3.4",
"cypress": "^4.11.0",
"cypress-file-upload": "^4.0.7",
"eslint-plugin-promise": "^4.2.1",
"firebase-admin": "^9.1.1",
"firebase-tools": "^8.6.0",
"gifwrap": "^0.9.2",
Expand Down
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,6 @@

<body>
<noscript>You need to enable JavaScript to use Sparkle.</noscript>
<div id="root"></div>
<div id="root">Loading...</div>
</body>
</html>
6 changes: 3 additions & 3 deletions reporting/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion reporting/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
},
"private": true,
"devDependencies": {
"@types/puppeteer": "^5.4.3"
"@types/puppeteer": "^5.4.4"
}
}
59 changes: 33 additions & 26 deletions src/components/atoms/UserAvatar/UserAvatar.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,26 @@
@import "scss/constants";

.UserAvatar {
$avatar-sizes-map: (
small: 25px,
medium: 40px,
large: 54px,
full: 100%,
);
$indicator-sizes-map: (
small: 8px,
medium: 10px,
large: 12px,
full: 25%,
);

// NOTE: parent and img mismatch due to legacy reasons
$default-avatar-size: 25px;
$default-image-size: 100%;
$default-indicator-size: 8px;

@include square-size($default-avatar-size);
position: relative;
width: 25px;
height: 25px;

&:hover {
.UserAvatar__nametag--hover {
Expand All @@ -19,25 +36,24 @@
}

&__image {
height: 100%;
width: 100%;
@include square-size($default-image-size);
border-radius: 50%;
vertical-align: unset;
}

&__status-indicator {
position: absolute;
bottom: -1px;
right: -1px;
bottom: 0;
right: 0;
border-radius: 50%;
height: 8px;
width: 8px;
z-index: z(user-avatar-status-indicator);
display: block;
@include square-size($default-indicator-size);

&--large {
height: 12px;
width: 12px;
@each $modifier, $size in $indicator-sizes-map {
&--#{$modifier} {
@include square-size($size);
}
}
}

Expand All @@ -49,19 +65,11 @@
}
}

&--small {
width: 25px;
height: 25px;
}

&--medium {
height: 40px;
width: 40px;
}

&--large {
height: 54px;
width: 54px;
@each $modifier, $size in $avatar-sizes-map {
&--#{$modifier},
&--#{$modifier} img {
@include square-size($size);
}
}

&__nametag {
Expand All @@ -74,12 +82,11 @@

text-align: center;

margin: 0 auto;
margin: 0 -50% 0 auto;
padding: 0 $spacing--xs;

bottom: 10%;
left: 50%;
margin-right: -50%;

border-radius: $border-radius--md;

Expand Down
13 changes: 6 additions & 7 deletions src/components/atoms/UserAvatar/UserAvatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@ import { useVenueId } from "hooks/useVenueId";

import "./UserAvatar.scss";

export type UserAvatarSize = "small" | "medium" | "large" | "full";

export interface UserAvatarProps {
user?: WithId<User>;
containerClassName?: string;
imageClassName?: string;
showNametag?: UsernameVisibility;
showStatus?: boolean;
onClick?: () => void;
large?: boolean;
medium?: boolean;
size?: UserAvatarSize;
}

// @debt the UserProfilePicture component serves a very similar purpose to this, we should unify them as much as possible
Expand All @@ -33,8 +34,7 @@ export const _UserAvatar: React.FC<UserAvatarProps> = ({
showNametag,
onClick,
showStatus,
large,
medium,
size,
}) => {
const venueId = useVenueId();

Expand All @@ -56,8 +56,7 @@ export const _UserAvatar: React.FC<UserAvatarProps> = ({

const containerClasses = classNames("UserAvatar", containerClassName, {
"UserAvatar--clickable": onClick !== undefined,
"UserAvatar--large": large,
"UserAvatar--medium": medium,
[`UserAvatar--${size}`]: size,
});

// const isOnline = useMemo(
Expand All @@ -77,7 +76,7 @@ export const _UserAvatar: React.FC<UserAvatarProps> = ({
const statusIndicatorClasses = classNames("UserAvatar__status-indicator", {
"UserAvatar__status-indicator--online": isOnline,
[`UserAvatar__status-indicator--${status}`]: isOnline && status,
"UserAvatar__status-indicator--large": large,
[`UserAvatar__status-indicator--${size}`]: size,
});

const statusIndicatorStyles = useMemo(
Expand Down
13 changes: 9 additions & 4 deletions src/components/molecules/ImageInput/ImageCollectionInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { useState, useCallback, useEffect } from "react";
import { FieldError, useForm } from "react-hook-form";
import "firebase/functions";
import firebase from "firebase/app";
import { ACCEPTED_IMAGE_TYPES } from "settings";

interface ImageInputProps {
collectionPath: string;
Expand Down Expand Up @@ -75,6 +76,8 @@ export const ImageCollectionInput: React.FC<ImageInputProps> = (props) => {
[]
);

const hasImageCollections = !!imageCollection.length;

// this keeps the component state synchronised with the parent form state
useEffect(() => {
if (selectedCollectionImageUrl) {
Expand Down Expand Up @@ -108,7 +111,7 @@ export const ImageCollectionInput: React.FC<ImageInputProps> = (props) => {
disabled={disabled}
type="file"
onChange={handleFileChange}
accept="image/png,image/x-png,image/gif,image/jpeg"
accept={ACCEPTED_IMAGE_TYPES}
className="default-input"
ref={register}
/>
Expand All @@ -131,9 +134,11 @@ export const ImageCollectionInput: React.FC<ImageInputProps> = (props) => {
value={imageUrlForPreview}
/>
{error?.message && <span className="input-error">{error.message}</span>}
<div style={{ marginTop: 10, fontSize: "16px" }}>
{`Or choose one of our popular ${imageType}`}
</div>
{hasImageCollections && (
<div style={{ marginTop: 10, fontSize: "16px" }}>
{`Or choose one of our popular ${imageType}`}
</div>
)}
<div
style={{
display: "flex",
Expand Down
2 changes: 1 addition & 1 deletion src/components/molecules/NavBar/NavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ export const NavBar: React.FC<NavBarPropsType> = ({ hasBackButton = true }) => {
overlay={ProfilePopover}
rootClose={true}
>
<UserAvatar user={userWithId} showStatus medium />
<UserAvatar user={userWithId} showStatus size="medium" />
</OverlayTrigger>
</div>
)}
Expand Down
Loading

0 comments on commit 3861cb5

Please sign in to comment.