Compare commits
No commits in common. "c372ea4a92b9b44598b7d2a63123425b5eabfe89" and "0e33be020d651b482d7f767ba1eeb37e1bbcc205" have entirely different histories.
c372ea4a92
...
0e33be020d
2 changed files with 23 additions and 17 deletions
|
@ -31,12 +31,16 @@ jobs:
|
||||||
run: bun install
|
run: bun install
|
||||||
|
|
||||||
- name: Build Dist (Staging)
|
- name: Build Dist (Staging)
|
||||||
run: VITE_CODE_VERSION=$GITHUB_SHA bun dist -m staging
|
run: bun dist -m staging
|
||||||
if: env.GITHUB_REF_NAME == 'master'
|
if: env.GITHUB_REF_NAME == 'master'
|
||||||
|
env:
|
||||||
|
VITE_CODE_VERSION: ${{ env.GITHUB_SHA }}
|
||||||
|
|
||||||
- name: Build Dist
|
- name: Build Dist
|
||||||
run: VITE_CODE_VERSION=$GITHUB_SHA bun dist
|
run: bun dist
|
||||||
if: env.GITHUB_REF_NAME != 'master'
|
if: env.GITHUB_REF_NAME != 'master'
|
||||||
|
env:
|
||||||
|
VITE_CODE_VERSION: ${{ env.GITHUB_SHA }}
|
||||||
|
|
||||||
- name: Depoly to Preview
|
- name: Depoly to Preview
|
||||||
uses: https://github.com/cloudflare/wrangler-action@v3
|
uses: https://github.com/cloudflare/wrangler-action@v3
|
||||||
|
|
|
@ -3,8 +3,6 @@ import {
|
||||||
type Component,
|
type Component,
|
||||||
For,
|
For,
|
||||||
Index,
|
Index,
|
||||||
Match,
|
|
||||||
Switch,
|
|
||||||
createMemo,
|
createMemo,
|
||||||
createRenderEffect,
|
createRenderEffect,
|
||||||
createSignal,
|
createSignal,
|
||||||
|
@ -149,10 +147,9 @@ const MediaAttachmentGrid: Component<{
|
||||||
>
|
>
|
||||||
<Index each={props.attachments}>
|
<Index each={props.attachments}>
|
||||||
{(item, index) => {
|
{(item, index) => {
|
||||||
const itemType = () => item().type;
|
switch (item().type) {
|
||||||
|
case "image":
|
||||||
return (
|
return (
|
||||||
<Switch>
|
|
||||||
<Match when={itemType() === "image"}>
|
|
||||||
<img
|
<img
|
||||||
data-sort={index}
|
data-sort={index}
|
||||||
data-media-type={item().type}
|
data-media-type={item().type}
|
||||||
|
@ -164,8 +161,9 @@ const MediaAttachmentGrid: Component<{
|
||||||
loading="lazy"
|
loading="lazy"
|
||||||
style={itemStyle(item())}
|
style={itemStyle(item())}
|
||||||
></img>
|
></img>
|
||||||
</Match>
|
);
|
||||||
<Match when={itemType() === "video"}>
|
case "video":
|
||||||
|
return (
|
||||||
<video
|
<video
|
||||||
data-sort={index}
|
data-sort={index}
|
||||||
data-media-type={item().type}
|
data-media-type={item().type}
|
||||||
|
@ -178,8 +176,9 @@ const MediaAttachmentGrid: Component<{
|
||||||
height={item().meta?.small?.height}
|
height={item().meta?.small?.height}
|
||||||
style={itemStyle(item())}
|
style={itemStyle(item())}
|
||||||
/>
|
/>
|
||||||
</Match>
|
);
|
||||||
<Match when={itemType() === "gifv"}>
|
case "gifv":
|
||||||
|
return (
|
||||||
<video
|
<video
|
||||||
data-sort={index}
|
data-sort={index}
|
||||||
data-media-type={item().type}
|
data-media-type={item().type}
|
||||||
|
@ -193,17 +192,20 @@ const MediaAttachmentGrid: Component<{
|
||||||
height={item().meta?.small?.height}
|
height={item().meta?.small?.height}
|
||||||
style={itemStyle(item())}
|
style={itemStyle(item())}
|
||||||
/>
|
/>
|
||||||
</Match>
|
);
|
||||||
<Match when={itemType() === "audio"}>
|
|
||||||
|
case "audio":
|
||||||
|
return (
|
||||||
<audio
|
<audio
|
||||||
data-sort={index}
|
data-sort={index}
|
||||||
data-media-type={item().type}
|
data-media-type={item().type}
|
||||||
src={item().url || undefined}
|
src={item().url || undefined}
|
||||||
controls
|
controls
|
||||||
></audio>
|
></audio>
|
||||||
</Match>
|
|
||||||
</Switch>
|
|
||||||
);
|
);
|
||||||
|
case "unknown":
|
||||||
|
return <div></div>;
|
||||||
|
}
|
||||||
}}
|
}}
|
||||||
</Index>
|
</Index>
|
||||||
</section>
|
</section>
|
||||||
|
|
Loading…
Reference in a new issue