Remove showing domain status in overview pannel
This commit is contained in:
parent
6df685831f
commit
1a5ab4d47e
@ -1,26 +1,35 @@
|
|||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import { Link, useNavigate, useOutletContext } from 'react-router-dom';
|
import {
|
||||||
|
Link,
|
||||||
|
// useNavigate,
|
||||||
|
useOutletContext
|
||||||
|
} from 'react-router-dom';
|
||||||
import { RequestError } from 'octokit';
|
import { RequestError } from 'octokit';
|
||||||
|
|
||||||
import { useOctokit } from 'context/OctokitContext';
|
import { useOctokit } from 'context/OctokitContext';
|
||||||
import { GitCommitWithBranch, OutletContextType } from '../../../../types';
|
import { GitCommitWithBranch, OutletContextType } from '../../../../types';
|
||||||
import { useGQLClient } from 'context/GQLClientContext';
|
// import { useGQLClient } from 'context/GQLClientContext';
|
||||||
import { Button, Heading, Avatar, Tag } from 'components/shared';
|
import {
|
||||||
|
// Button,
|
||||||
|
Heading,
|
||||||
|
Avatar,
|
||||||
|
// Tag
|
||||||
|
} from 'components/shared';
|
||||||
import { getInitials } from 'utils/geInitials';
|
import { getInitials } from 'utils/geInitials';
|
||||||
import {
|
import {
|
||||||
BranchStrokeIcon,
|
BranchStrokeIcon,
|
||||||
CheckRoundFilledIcon,
|
// CheckRoundFilledIcon,
|
||||||
ClockIcon,
|
// ClockIcon,
|
||||||
CursorBoxIcon,
|
CursorBoxIcon,
|
||||||
GithubStrokeIcon,
|
GithubStrokeIcon,
|
||||||
GlobeIcon,
|
// GlobeIcon,
|
||||||
LinkIcon,
|
LinkIcon,
|
||||||
CalendarDaysIcon,
|
CalendarDaysIcon,
|
||||||
} from 'components/shared/CustomIcon';
|
} from 'components/shared/CustomIcon';
|
||||||
import { Activity } from 'components/projects/project/overview/Activity';
|
import { Activity } from 'components/projects/project/overview/Activity';
|
||||||
import { OverviewInfo } from 'components/projects/project/overview/OverviewInfo';
|
import { OverviewInfo } from 'components/projects/project/overview/OverviewInfo';
|
||||||
import { relativeTimeMs } from 'utils/time';
|
import { relativeTimeMs } from 'utils/time';
|
||||||
import { Domain, DomainStatus } from 'gql-client';
|
// import { Domain, DomainStatus } from 'gql-client';
|
||||||
import { AuctionCard } from 'components/projects/project/overview/Activity/AuctionCard';
|
import { AuctionCard } from 'components/projects/project/overview/Activity/AuctionCard';
|
||||||
|
|
||||||
const COMMITS_PER_PAGE = 4;
|
const COMMITS_PER_PAGE = 4;
|
||||||
@ -28,12 +37,12 @@ const PROJECT_UPDATE_WAIT_MS = 5000;
|
|||||||
|
|
||||||
const OverviewTabPanel = () => {
|
const OverviewTabPanel = () => {
|
||||||
const { octokit } = useOctokit();
|
const { octokit } = useOctokit();
|
||||||
const navigate = useNavigate();
|
// const navigate = useNavigate();
|
||||||
const [activities, setActivities] = useState<GitCommitWithBranch[]>([]);
|
const [activities, setActivities] = useState<GitCommitWithBranch[]>([]);
|
||||||
const [fetchingActivities, setFetchingActivities] = useState(true);
|
const [fetchingActivities, setFetchingActivities] = useState(true);
|
||||||
const [liveDomain, setLiveDomain] = useState<Domain>();
|
// const [liveDomain, setLiveDomain] = useState<Domain>();
|
||||||
|
|
||||||
const client = useGQLClient();
|
// const client = useGQLClient();
|
||||||
const { project, onUpdate } = useOutletContext<OutletContextType>();
|
const { project, onUpdate } = useOutletContext<OutletContextType>();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -107,22 +116,22 @@ const OverviewTabPanel = () => {
|
|||||||
return () => clearInterval(timerId);
|
return () => clearInterval(timerId);
|
||||||
}, [onUpdate]);
|
}, [onUpdate]);
|
||||||
|
|
||||||
useEffect(() => {
|
// useEffect(() => {
|
||||||
const fetchLiveProdDomain = async () => {
|
// const fetchLiveProdDomain = async () => {
|
||||||
const { domains } = await client.getDomains(project.id, {
|
// const { domains } = await client.getDomains(project.id, {
|
||||||
branch: project.prodBranch,
|
// branch: project.prodBranch,
|
||||||
status: DomainStatus.Live,
|
// status: DomainStatus.Live,
|
||||||
});
|
// });
|
||||||
|
|
||||||
if (domains.length === 0) {
|
// if (domains.length === 0) {
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
|
|
||||||
setLiveDomain(domains[0]);
|
// setLiveDomain(domains[0]);
|
||||||
};
|
// };
|
||||||
|
|
||||||
fetchLiveProdDomain();
|
// fetchLiveProdDomain();
|
||||||
}, [project]);
|
// }, [project]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="grid grid-cols-5 gap-6 md:gap-[72px]">
|
<div className="grid grid-cols-5 gap-6 md:gap-[72px]">
|
||||||
@ -153,7 +162,7 @@ const OverviewTabPanel = () => {
|
|||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<OverviewInfo label="Domain" icon={<GlobeIcon />}>
|
{/* <OverviewInfo label="Domain" icon={<GlobeIcon />}>
|
||||||
{liveDomain ? (
|
{liveDomain ? (
|
||||||
<Tag type="positive" size="xs" leftIcon={<CheckRoundFilledIcon />}>
|
<Tag type="positive" size="xs" leftIcon={<CheckRoundFilledIcon />}>
|
||||||
Connected
|
Connected
|
||||||
@ -174,7 +183,7 @@ const OverviewTabPanel = () => {
|
|||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</OverviewInfo>
|
</OverviewInfo> */}
|
||||||
{project.deployments.length !== 0 ? (
|
{project.deployments.length !== 0 ? (
|
||||||
<>
|
<>
|
||||||
{/* SOURCE */}
|
{/* SOURCE */}
|
||||||
@ -195,13 +204,13 @@ const OverviewTabPanel = () => {
|
|||||||
<div className="flex gap-2 items-center">
|
<div className="flex gap-2 items-center">
|
||||||
<Link
|
<Link
|
||||||
to={
|
to={
|
||||||
deployment.domain.name
|
deployment.domain?.name
|
||||||
? `https://${deployment.domain.name}`
|
? `https://${deployment.domain.name}`
|
||||||
: `https://${project.name.toLowerCase()}.${deployment.deployer.baseDomain}`
|
: `https://${project.name.toLowerCase()}.${deployment.deployer.baseDomain}`
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<span className="text-controls-primary dark:text-foreground group hover:border-controls-primary transition-colors border-b border-b-transparent flex gap-2 items-center text-sm tracking-tight">
|
<span className="text-controls-primary dark:text-foreground group hover:border-controls-primary transition-colors border-b border-b-transparent flex gap-2 items-center text-sm tracking-tight">
|
||||||
{deployment.domain.name ??
|
{deployment.domain?.name ??
|
||||||
`https://${project.name.toLowerCase()}.${deployment.deployer.baseDomain}`}
|
`https://${project.name.toLowerCase()}.${deployment.deployer.baseDomain}`}
|
||||||
<LinkIcon className="group-hover:rotate-45 transition-transform" />
|
<LinkIcon className="group-hover:rotate-45 transition-transform" />
|
||||||
</span>
|
</span>
|
||||||
|
Loading…
Reference in New Issue
Block a user