Skip to content

Commit

Permalink
chore(web): fix layerName random on upload directly (#781)
Browse files Browse the repository at this point in the history
  • Loading branch information
pyshx committed Nov 1, 2023
1 parent 16cbcde commit 2d69621
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
Expand Up @@ -112,7 +112,7 @@ const LayerItem = ({
onBlur={handleEditExit}
/>
) : (
layerTitle
<LayerTitle>{layerTitle}</LayerTitle>
)}
<HideLayer onClick={handleUpdateVisibility}>
<Text size="footnote">{value}</Text>
Expand All @@ -124,6 +124,17 @@ const LayerItem = ({

export default LayerItem;

const LayerTitle = styled.div`
overflow: hidden;
color: ${({ theme }) => theme.content.main};
text-overflow: ellipsis;
font-family: Noto Sans;
font-size: 12px;
font-style: normal;
font-weight: 400;
line-height: 20px;
`;

const ContentWrapper = styled.div`
display: flex;
align-items: center;
Expand Down
5 changes: 3 additions & 2 deletions web/src/beta/hooks/useAssetUploader/hooks.tsx
Expand Up @@ -11,7 +11,7 @@ export default ({
assetType,
}: {
workspaceId?: string;
onAssetSelect?: (inputValue?: string) => void;
onAssetSelect?: (inputValue?: string, name?: string) => void;
assetType?: string;
}) => {
const { useCreateAssets } = useAssetsFetcher();
Expand All @@ -32,8 +32,9 @@ export default ({
file: files,
});
const assetUrl = result?.data[0].data?.createAsset?.asset.url;
const assetName = result?.data[0].data?.createAsset?.asset.name;

onAssetSelect?.(assetUrl);
onAssetSelect?.(assetUrl, assetName);
},
[workspaceId, useCreateAssets, onAssetSelect],
);
Expand Down

0 comments on commit 2d69621

Please sign in to comment.