Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,10 @@ export const deleteDeployment: AsyncAction = async ({
);
};

export const aliasDeployment: AsyncAction<{
id: string;
}> = async ({ state, effects, actions }, { id }) => {
export const aliasDeployment: AsyncAction<string> = async (
{ state, effects, actions },
id
) => {
const zeitConfig = effects.zeit.getConfig(state.editor.currentSandbox);

try {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
import React from 'react';
import { useOvermind } from 'app/overmind';
import { ZeitDeployment } from '@codesandbox/common/lib/types';
import React, { FunctionComponent } from 'react';

import { useOvermind } from 'app/overmind';

import { Action } from '../../../../elements';

type Props = {
deploy: ZeitDeployment;
};

export const AliasDeploymentButton: React.FC<Props> = ({
export const AliasDeploymentButton: FunctionComponent<Props> = ({
deploy: { alias: aliases, uid: id },
}) => {
const {
actions: {
deployment: { aliasDeployment },
},
} = useOvermind();

return (
<Action
disabled={aliases.length > 0}
onClick={() => aliasDeployment({ id })}
>
<Action disabled={aliases.length > 0} onClick={() => aliasDeployment(id)}>
{aliases.length > 0 ? 'Aliased' : 'Alias'}
</Action>
);
Expand Down