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