fix(onboarding/survey): fix alert appearing in survey scene

This commit is contained in:
Aminejv 2021-11-11 18:06:38 +01:00
parent 19a63411dc
commit 8eb312b305
4 changed files with 8 additions and 9 deletions

View File

@ -96,7 +96,7 @@ const surveyPage = {
id: "NAV_SURVEY",
name: "Onboarding Survey",
pageTitle: "Welcome to Slate",
pathname: "/_/welcome",
pathname: "/_/data",
ignore: true,
};

View File

@ -218,11 +218,9 @@ export default class ApplicationLayout extends React.Component {
)}
<Alert
noWarning={
this.props.page?.id === "NAV_SIGN_IN"
this.props.page?.id === "NAV_SIGN_IN" || this.props.page?.id === "NAV_SURVEY"
? true
: this.props.viewer
? !this.props.viewer?.onboarding?.survey
: false
: !!this.props.viewer
}
onAction={this.props.onAction}
id={this.props.isMobile ? "slate-mobile-alert" : null}

View File

@ -51,7 +51,7 @@ export function Content({ viewer, onAction, page, ...props }) {
return (
<div css={STYLES_DATAVIEWER_WRAPPER} {...props}>
{objects.length ? (
<TagsOnboarding isActive={isOnboardingActive}>
<TagsOnboarding onAction={onAction} viewer={viewer} isActive={isOnboardingActive}>
<DataView
key="scene-files-folder"
/** TODO(amine): when updating filters, update isOwner prop */

View File

@ -1,6 +1,7 @@
import * as React from "react";
import * as System from "~/components/system";
import { motion } from "framer-motion";
import { css } from "@emotion/react";
import { ModalPortal } from "../ModalPortal";
@ -32,14 +33,14 @@ const STYLES_POPUP_CONTENT = css`
export default function Popup({ children, header, css, ...props }) {
return (
<ModalPortal {...props}>
<div css={[STYLES_ONBOARDING_POPUP, css]}>
<ModalPortal>
<motion.div css={[STYLES_ONBOARDING_POPUP, css]} {...props}>
<System.H5 as="h1" color="textBlack" css={STYLES_POPUP_HEADER}>
{header}
</System.H5>
<System.Divider color="borderGrayLight" />
<div css={STYLES_POPUP_CONTENT}>{children}</div>
</div>
</motion.div>
</ModalPortal>
);
}