Skip to content

Commit

Permalink
Fix errors
Browse files Browse the repository at this point in the history
  • Loading branch information
istarkov committed Jun 14, 2023
1 parent 0243ae3 commit dc11116
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 24 deletions.
1 change: 1 addition & 0 deletions apps/builder/app/builder/features/topbar/domains.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,7 @@ const DomainItem = (props: {

handleUpdateStatus();
}}
isPublishing={props.isPublishing}
/>
</Grid>
</CollapsibleDomainSection>
Expand Down
4 changes: 3 additions & 1 deletion apps/builder/app/builder/features/topbar/entri.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ export const Entri = ({
dnsRecords,
domain,
onClose,
isPublishing,
}: {
dnsRecords: DnsRecord[];
domain: string;
onClose: (detail: EntriCloseDetail) => void;
isPublishing: boolean;
}) => {
entriGlobalStyles();
const { error, isOpen, showDialog } = useEntri({
Expand All @@ -27,7 +29,7 @@ export const Entri = ({
{error !== undefined && <Text color="destructive">{error}</Text>}

<Button
disabled={isOpen}
disabled={isOpen || isPublishing}
color="neutral"
css={{ width: "100%", flexShrink: 0 }}
onClick={() => {
Expand Down
44 changes: 21 additions & 23 deletions apps/builder/app/builder/features/topbar/publish.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,20 @@ const Publish = ({
);
};

const ErrorText = ({ children }: { children: string }) => (
<Flex
css={{
m: theme.spacing[9],
overflowWrap: "anywhere",
}}
gap={2}
direction={"column"}
>
<Text color="destructive">{children}</Text>
<Text color="subtle">Please try again later</Text>
</Flex>
);

const Content = (props: { projectId: Project["id"] }) => {
const [newDomains, setNewDomains] = useState(new Set<string>());
const {
Expand Down Expand Up @@ -390,17 +404,7 @@ const Content = (props: { projectId: Project["id"] }) => {
<>
<ScrollArea>
{projectSystemError !== undefined && (
<Flex
css={{
m: theme.spacing[9],
overflowWrap: "anywhere",
}}
gap={2}
direction={"column"}
>
<Text color="destructive">{projectSystemError}</Text>
<Text color="subtle">Please try again later</Text>
</Flex>
<ErrorText>{projectSystemError}</ErrorText>
)}

{projectData?.success && (
Expand All @@ -412,10 +416,6 @@ const Content = (props: { projectId: Project["id"] }) => {
/>
)}

{domainSystemError !== undefined && (
<Text color="destructive">{domainSystemError}</Text>
)}

{domainsResult?.success === true && (
<Domains
newDomains={newDomains}
Expand All @@ -425,15 +425,13 @@ const Content = (props: { projectId: Project["id"] }) => {
isPublishing={isPublishing}
/>
)}

{domainSystemError !== undefined && (
<ErrorText>{domainSystemError}</ErrorText>
)}

{domainsResult?.success === false && (
<Label
css={{
overflowWrap: "anywhere",
color: theme.colors.foregroundDestructive,
}}
>
<div>{domainsResult.error}</div>
</Label>
<ErrorText>{domainsResult.error}</ErrorText>
)}
</ScrollArea>

Expand Down

0 comments on commit dc11116

Please sign in to comment.