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