hide onboarding close X's if no models in config
This commit is contained in:
parent
0e70ff083e
commit
dac8bae2ba
2 changed files with 6 additions and 2 deletions
|
|
@ -5,6 +5,7 @@ import styled from "styled-components";
|
|||
import { CloseButton, defaultBorderRadius, vscInputBackground } from "../";
|
||||
import { getLocalStorage, setLocalStorage } from "../../util/localStorage";
|
||||
import { useOnboardingCard } from "./hooks/useOnboardingCard";
|
||||
import { useAppSelector } from "../../redux/hooks";
|
||||
|
||||
const StyledCard = styled.div`
|
||||
margin: auto;
|
||||
|
|
@ -26,6 +27,7 @@ interface OnboardingCardProps {
|
|||
|
||||
export function OnboardingCard({ isDialog }: OnboardingCardProps) {
|
||||
const onboardingCard = useOnboardingCard();
|
||||
const config = useAppSelector((store) => store.config.config);
|
||||
|
||||
function renderTabContent() {
|
||||
switch (onboardingCard.activeTab) {
|
||||
|
|
@ -53,7 +55,7 @@ export function OnboardingCard({ isDialog }: OnboardingCardProps) {
|
|||
activeTab={onboardingCard.activeTab || "Best"}
|
||||
onTabClick={onboardingCard.setActiveTab}
|
||||
/>
|
||||
{!isDialog && (
|
||||
{!isDialog && !!config.models.length && (
|
||||
<CloseButton onClick={() => onboardingCard.close()}>
|
||||
<XMarkIcon className="mt-1.5 hidden h-5 w-5 hover:brightness-125 sm:flex" />
|
||||
</CloseButton>
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import { TabTitle } from "../components/OnboardingCardTabs";
|
|||
import { useOnboardingCard } from "../hooks";
|
||||
import OnboardingLocalTab from "../tabs/OnboardingLocalTab";
|
||||
import MainTab from "./tabs/main";
|
||||
import { useAppSelector } from "../../../redux/hooks";
|
||||
|
||||
const StyledCard = styled.div`
|
||||
margin: auto;
|
||||
|
|
@ -29,6 +30,7 @@ interface OnboardingCardProps {
|
|||
|
||||
export function PlatformOnboardingCard({ isDialog }: OnboardingCardProps) {
|
||||
const onboardingCard = useOnboardingCard();
|
||||
const config = useAppSelector((store) => store.config.config);
|
||||
|
||||
if (getLocalStorage("onboardingStatus") === undefined) {
|
||||
setLocalStorage("onboardingStatus", "Started");
|
||||
|
|
@ -38,7 +40,7 @@ export function PlatformOnboardingCard({ isDialog }: OnboardingCardProps) {
|
|||
|
||||
return (
|
||||
<StyledCard className="xs:py-4 xs:px-4 relative px-2 py-3">
|
||||
{!isDialog && (
|
||||
{!isDialog && !!config.models.length && (
|
||||
<CloseButton onClick={() => onboardingCard.close()}>
|
||||
<XMarkIcon className="mt-1.5 hidden h-5 w-5 hover:brightness-125 sm:flex" />
|
||||
</CloseButton>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue