Skip to content

AAA I can set an announcement with funnels and CTA button #1440

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 60 commits into from
Sep 24, 2021
Merged
Show file tree
Hide file tree
Changes from 54 commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
ffe0f3b
AAA I can set an announcement with funnels and CTA button
oleksii-front May 25, 2021
659a5c4
updates
oleksii-front May 26, 2021
40cf2f9
updates
oleksii-front May 27, 2021
899a3f0
Minor changes
oleksii-front May 31, 2021
81180bb
add error and isActionButon control to BennerAdmin
oleksii-front May 31, 2021
8b694f7
minor changes before review
oleksii-front Jun 3, 2021
3074528
discussion_r644699780
oleksii-front Jun 13, 2021
91c882a
discussion_r644699971
oleksii-front Jun 13, 2021
48653ae
discussion_r644700886
oleksii-front Jun 13, 2021
c7fb982
discussion_r644701249
oleksii-front Jun 13, 2021
4a18ef3
discussion_r644702532
oleksii-front Jun 13, 2021
9ce4fab
discussion_r644702936
oleksii-front Jun 13, 2021
3585573
discussion_r644710614
oleksii-front Jun 13, 2021
14e353b
discussion_r644711161
oleksii-front Jun 13, 2021
9a37437
discussion_r644711366
oleksii-front Jun 13, 2021
f93fdc0
discussion_r644714568
oleksii-front Jun 13, 2021
4e7eafe
discussion_r644716944
oleksii-front Jun 13, 2021
fcd796a
discussion_r644717292
oleksii-front Jun 13, 2021
a62d41a
discussion_r644717671
oleksii-front Jun 13, 2021
332ea6a
discussion_r644719421
oleksii-front Jun 13, 2021
8a74cea
discussion_r644719631
oleksii-front Jun 13, 2021
ab6186d
discussion_r644704264
oleksii-front Jun 13, 2021
fbbebcd
fixes as per PR + banner modal/confirm modal merged
Jul 1, 2021
7f30e59
PR fixes + minor css changes
Jul 2, 2021
0a25561
removed stopPropagation + noop from modal
Jul 2, 2021
16b3be4
user announcement style fixes
Jul 8, 2021
8445fd3
formatting prettier
Jul 9, 2021
07e357d
PR fixes
Jul 11, 2021
985b616
fix cancel btn color style
Jul 12, 2021
e21bde4
pr comment fixes
Jul 12, 2021
3f689b8
pr fixes
Jul 15, 2021
0e0352d
minor logic url/force funnel fix
Jul 16, 2021
07f250c
minor change
Jul 27, 2021
52739ac
minor fix
Jul 27, 2021
de68584
pr fixes
Aug 18, 2021
3adc804
Merge branch 'staging' of github.com:sparkletown/sparkle into feature…
Sep 15, 2021
d8b731f
fixed banner positioning + force funnel banner close on btn click
Sep 15, 2021
44581e4
Merge branch 'staging' of github.com:sparkletown/sparkle into feature…
Sep 15, 2021
3f16d02
Merge branch 'staging' of github.com:sparkletown/sparkle into feature…
Sep 16, 2021
68b92ab
Merge branch 'staging' of github.com:sparkletown/sparkle into feature…
Sep 17, 2021
7eb5c07
update announce ui + minor refactor
Sep 17, 2021
297dca6
minor ui fix
Sep 17, 2021
220c0f6
Merge branch 'staging' of github.com:sparkletown/sparkle into feature…
Sep 17, 2021
ed799a1
banner announcement fixes pr
Sep 20, 2021
c8f54e7
removed comment
Sep 20, 2021
d72ae7b
Merge branch 'staging' of github.com:sparkletown/sparkle into feature…
Sep 20, 2021
a0b5de8
removed banner message from venue creation
Sep 20, 2021
bf7f576
Merge branch 'staging' of github.com:sparkletown/sparkle into feature…
Sep 20, 2021
a509b53
Merge branch 'staging' of github.com:sparkletown/sparkle into feature…
Sep 20, 2021
d93f7db
mr fixes + announcement preview + ui redone
Sep 23, 2021
b0a1908
Merge branch 'staging' of github.com:sparkletown/sparkle into feature…
Sep 23, 2021
f4d50ec
removed unnecessary classes
Sep 23, 2021
cc3ea03
Merge branch 'staging' of github.com:sparkletown/sparkle into feature…
Sep 23, 2021
059ddbc
fix height navbar
Sep 23, 2021
515bb0d
Merge branch 'staging' of github.com:sparkletown/sparkle into feature…
Sep 24, 2021
a4e73af
mr fixes + announcement position fix for admin
Sep 24, 2021
1223c52
Merge branch 'staging' of github.com:sparkletown/sparkle into feature…
Sep 24, 2021
bf4ee63
minor fixes
Sep 24, 2021
271ce1e
Merge branch 'staging' of github.com:sparkletown/sparkle into feature…
Sep 24, 2021
4c96067
Merge branch 'staging' of github.com:sparkletown/sparkle into feature…
Sep 24, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions functions/venue.js
Original file line number Diff line number Diff line change
Expand Up @@ -372,11 +372,6 @@ const createBaseUpdateVenueData = (data, doc) => {
updated.mapBackgroundImageUrl = data.mapBackgroundImageUrl;
}

// @debt do we need to be able to set this here anymore? I think we have a dedicated function for it?
if (data.bannerMessage) {
updated.bannerMessage = data.bannerMessage;
}

if (data.parentId) {
updated.parentId = data.parentId;
}
Expand Down Expand Up @@ -904,7 +899,7 @@ exports.adminUpdateBannerMessage = functions.https.onCall(
.firestore()
.collection("venues")
.doc(data.venueId)
.update({ bannerMessage: data.bannerMessage || null });
.update({ banner: data.banner || null });
}
);

Expand Down
1 change: 0 additions & 1 deletion src/api/admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ export type VenueInput = AdvancedVenueInput &
columns?: number;
width?: number;
height?: number;
bannerMessage?: string;
parentId?: string;
owners?: string[];
chatTitle?: string;
Expand Down
23 changes: 16 additions & 7 deletions src/api/bannerAdmin.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
import Bugsnag from "@bugsnag/js";
import firebase from "firebase/app";

export const makeUpdateBanner = (
venueId: string,
onError?: (errorMsg: string) => void
) => async (message?: string): Promise<void> => {
import { Banner } from "types/banner";

export interface UpdateBannerProps {
venueId: string;
banner?: Banner;
onError?: (errorMsg: string) => void;
}

export const updateBanner = async ({
venueId,
banner,
onError = () => {},
}: UpdateBannerProps): Promise<void> => {
const params = {
venueId,
bannerMessage: message ?? "",
banner: banner ?? firebase.firestore.FieldValue.delete(),
};

await firebase
Expand All @@ -16,9 +25,9 @@ export const makeUpdateBanner = (
.catch((e) => {
Bugsnag.notify(e, (event) => {
event.addMetadata("context", {
location: "api/bannerAdmin::makeUpdateBanner",
location: "api/bannerAdmin::updateBanner",
venueId,
message,
banner,
});
});
onError?.(e.toString());
Expand Down
3 changes: 3 additions & 0 deletions src/assets/icons/close-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
@import "scss/constants.scss";

.ConfirmationModal {
.modal-content {
background: $modal-background--confirm;
}
text-align: center;

&__message {
padding: 10px 0 30px 0;
}

&__buttons {
display: flex;
width: 70%;
margin: 0 auto;
}
}
28 changes: 12 additions & 16 deletions src/components/atoms/ConfirmationModal/ConfirmationModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,23 @@ interface ConfirmationModalProps {
show?: boolean;
header?: string;
message: string;
no?: string;
yes?: string;
cancelBtnLabel?: string;
saveBtnLabel?: string;
centered?: boolean;
onConfirm: () => void;
onCancel?: () => void;
isCentered?: boolean;
}

export const ConfirmationModal: React.FC<ConfirmationModalProps> = ({
show,
header,
message,
no = "No",
yes = "Yes",
centered = true,
onConfirm,
onCancel,
cancelBtnLabel = "No",
saveBtnLabel = "Yes",
isCentered = false,
}) => {
const [isVisible, setIsVisible] = useState(true);

Expand All @@ -49,20 +50,15 @@ export const ConfirmationModal: React.FC<ConfirmationModalProps> = ({
const isShown = show !== undefined ? show : isVisible;

return (
<Modal
className="ConfirmationModal"
show={isShown}
onHide={hide}
centered={centered}
>
<Modal show={isShown} onHide={hide} centered={isCentered}>
<Modal.Body>
<div>
{hasHeader && <Modal.Title>{header}</Modal.Title>}
<div className="ConfirmationModal">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why the class of the ConfirmationModal is moved? it should be set on the container element.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's still a container class for the confirmation content body

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well, let's say we want to change the background of the confirmation modal. If we change it for the current ".ConfirmationModal" selector, it'll look this way, leaving black borders (see the screenshot). But if we assign this class name to the Modal component, we'll be able to target a child to change the background of the needed element.

image

{hasHeader && <h4>{header}</h4>}
<div className="ConfirmationModal__message">{message}</div>
<div className="ConfirmationModal__buttons">
<ButtonNG onClick={cancel}>{no}</ButtonNG>
<ButtonNG variant="primary" onClick={confirm}>
{yes}
<ButtonNG onClick={cancel}>{cancelBtnLabel}</ButtonNG>
<ButtonNG variant="danger" onClick={confirm}>
{saveBtnLabel}
</ButtonNG>
</div>
</div>
Expand Down
121 changes: 101 additions & 20 deletions src/components/molecules/AnnouncementMessage/AnnouncementMessage.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,42 +3,123 @@
$spacing: 15px;
$close-icon-width: 20px;
$message-margin: $spacing + $close-icon-width + 5px;
$action-button-height: 30px;
$action-button-padding: 6px;
$announce-box-shadow: 0px 2px 20px 5px;

.announcement-container {
.AnnouncementMessage {
display: block;
z-index: z(announcement);
position: absolute;
background: $primary;
top: 66px;
left: 50%;
width: 500px;
margin: 0 auto 0 -250px;
position: relative;
background: $announcement-background;
width: $announcement-container-width;
height: auto;
min-height: 70px;
transition: left 0.1s linear;
padding: $spacing 0;
backdrop-filter: blur(50px);
text-align: center;
position: absolute;
border-radius: 0px 0px $border-radius--xl $border-radius--xl;
border: 1px solid opaque-white(0.4);
border-top: none;
box-sizing: border-box;
box-shadow: $announce-box-shadow opaque-white(0.35);
left: 0;
right: 0;
margin: 0 auto;
z-index: z(announcement-banner);

&.centered {
left: 50%;
&--withButton {
min-height: $announcement-container-height;
}

padding: $spacing 0;
border-radius: 0 0 20px 20px;
text-align: center;
&__fullscreen {
position: fixed;
border: 1px solid opaque-white(0.4);
z-index: z(announcement-banner);
border-radius: $border-radius--xl;
top: 40%;
border-radius: 16px;

&--admin {
top: 35%;
position: absolute;
}
}

&__default-text {
opacity: 0.6;
}

&__content {
font-size: $font-size--md;
width: 90%;
margin-left: auto;
margin-right: auto;

p {
margin-bottom: 0px;
}
}

&__action-button {
display: inline-block;
background-color: $primary--live;
min-width: $announce-button-width;
min-height: $action-button-height;
font-size: $font-size--md;
font-weight: $font-weight--500;
padding: $action-button-padding $spacing--lg;

.close-button {
background: transparent;
border: none;
color: $white;
&-admin {
background-color: $primary--darker;
}
}

&__close-button {
cursor: pointer;
position: absolute;
top: $spacing;
right: $spacing;
background: url("/assets/icons/close-icon.svg");
height: 20px;
width: 20px;
&:focus,
&:hover {
color: var(--primary-color);
text-decoration: underline;
}
}
}

.announcement-message {
margin: 0 $message-margin;
&__container {
top: $navbar-height;
left: 0;
right: 0;
width: 100%;
z-index: z(announcement-banner);
display: flex;
justify-content: center;
align-items: flex-start;
position: absolute;

&--centered {
bottom: 0;
position: fixed;
display: flex;
align-items: center;
background-color: opaque-black(0.6);
}

&--admin {
position: relative;
position: absolute;
height: 210px;
top: 130px;
}

&--canceled {
position: relative;
top: 0;
}
}
}
Loading