Skip to content

Commit

Permalink
Merge branch 'staging' into update-eslint-plugin-promise
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-lvov committed Jul 22, 2021
2 parents 68f59e4 + b066aab commit 755bcb6
Show file tree
Hide file tree
Showing 43 changed files with 337 additions and 363 deletions.
2 changes: 1 addition & 1 deletion firestore.rules
Expand Up @@ -18,7 +18,7 @@ service cloud.firestore {
allow write: if request.auth.uid != null;
}
match /users/{userId} {
allow read: if true;
allow read: if request.auth.uid != null;
allow write: if request.auth.uid == userId;

match /visits/{venueId} {
Expand Down
27 changes: 17 additions & 10 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -8,15 +8,15 @@
"@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/mixpanel-browser": "^2.35.4",
"@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 Down
2 changes: 1 addition & 1 deletion public/index.html
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
Expand Up @@ -11,6 +11,6 @@
},
"private": true,
"devDependencies": {
"@types/puppeteer": "^5.4.3"
"@types/puppeteer": "^5.4.4"
}
}
9 changes: 0 additions & 9 deletions src/api/admin.ts
Expand Up @@ -41,13 +41,11 @@ export interface AdvancedVenueInput {
type VenueImageFileKeys =
| "bannerImageFile"
| "logoImageFile"
| "mapIconImageFile"
| "mapBackgroundImageFile";

type VenueImageUrlKeys =
| "bannerImageUrl"
| "logoImageUrl"
| "mapIconImageUrl"
| "mapBackgroundImageUrl";

type ImageFileKeys =
Expand Down Expand Up @@ -80,7 +78,6 @@ export type VenueInput = AdvancedVenueInput &
name: string;
bannerImageFile?: FileList;
logoImageFile?: FileList;
mapIconImageFile?: FileList;
mapBackgroundImageFile?: FileList;
subtitle: string;
description: string;
Expand Down Expand Up @@ -145,8 +142,6 @@ type FirestoreRoomInput_v2 = Omit<RoomInput_v2, RoomImageFileKeys> &
};

export type PlacementInput = {
mapIconImageFile?: FileList;
mapIconImageUrl?: string;
addressText?: string;
notes?: string;
placement?: Omit<VenuePlacement, "state">;
Expand Down Expand Up @@ -185,10 +180,6 @@ const createFirestoreVenueInput = async (input: VenueInput, user: UserInfo) => {
fileKey: "bannerImageFile",
urlKey: "bannerImageUrl",
},
{
fileKey: "mapIconImageFile",
urlKey: "mapIconImageUrl",
},
{
fileKey: "mapBackgroundImageFile",
urlKey: "mapBackgroundImageUrl",
Expand Down
59 changes: 33 additions & 26 deletions src/components/atoms/UserAvatar/UserAvatar.scss
@@ -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
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 @@ -76,7 +75,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
3 changes: 2 additions & 1 deletion src/components/molecules/ChatMessageBox/ChatMessageBox.scss
Expand Up @@ -12,7 +12,8 @@
}

&__input {
width: 100%;
text-align: left;
padding-left: $spacing--lg;
}

&__submit-button {
Expand Down
2 changes: 1 addition & 1 deletion src/components/molecules/ChatMessageBox/ChatMessageBox.tsx
Expand Up @@ -111,7 +111,7 @@ export const ChatMessageBox: React.FC<ChatMessageBoxProps> = ({
onSubmit={hasChosenThread ? sendReplyToThread : sendMessageToChat}
>
<InputField
containerClassName="Chatbox__input"
inputClassName="Chatbox__input"
ref={register({ required: true })}
name="message"
placeholder={`Write your ${placeholderValue}...`}
Expand Down
2 changes: 1 addition & 1 deletion src/components/molecules/NavBar/NavBar.tsx
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
16 changes: 8 additions & 8 deletions src/components/organisms/AppRouter/AdminSubrouter.tsx
Expand Up @@ -19,31 +19,31 @@ export const AdminSubrouter: React.FC = () => {
{/* Admin V1 */}

<Route path="/admin/venue/rooms/:venueId">
<Provided withWorldUsers withRelatedVenues>
<Provided withWorldUsers>
<RoomsForm />
</Provided>
</Route>

<Route path="/admin/venue/creation">
<Provided withWorldUsers withRelatedVenues>
<Provided withWorldUsers>
<VenueWizard />
</Provided>
</Route>

<Route path="/admin/venue/edit/:venueId">
<Provided withWorldUsers withRelatedVenues>
<Provided withWorldUsers>
<VenueWizard />
</Provided>
</Route>

<Route path="/admin/:venueId">
<Provided withWorldUsers withRelatedVenues>
<Provided withWorldUsers>
<Admin />
</Provided>
</Route>

<Route path="/admin">
<Provided withWorldUsers withRelatedVenues>
<Provided withWorldUsers>
<Admin />
</Provided>
</Route>
Expand All @@ -57,19 +57,19 @@ export const AdminSubrouter: React.FC = () => {
</Route>

<Route path="/admin-ng/advanced-settings/:venueId?">
<Provided withWorldUsers withRelatedVenues>
<Provided withWorldUsers>
<AdminAdvancedSettings />
</Provided>
</Route>

<Route path="/admin-ng/create/venue">
<Provided withWorldUsers withRelatedVenues>
<Provided withWorldUsers>
<VenueWizardV2 />
</Provided>
</Route>

<Route path="/admin-ng/edit/:venueId">
<Provided withWorldUsers withRelatedVenues>
<Provided withWorldUsers>
<VenueWizardV2 />
</Provided>
</Route>
Expand Down

0 comments on commit 755bcb6

Please sign in to comment.