Skip to content

Commit

Permalink
Merge pull request #63 from hytech-racing/preview-download-links
Browse files Browse the repository at this point in the history
mapped download button over selectedData.mcap_files
  • Loading branch information
kaisernarkotic authored Nov 24, 2024
2 parents 96feac5 + 4ac2edd commit f82fd70
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VITE_API_URL=https://api-url:port
VITE_API_URL=api-url:port
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,8 @@ dist-ssr
*.ntvs*
*.njsproj
*.sln
*.sw?
*.sw?

.env
.env.local
.env.*
9 changes: 5 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"storybook": "^8.3.4",
"typescript": "^5.5.3",
"typescript-eslint": "^8.0.1",
"vite": "^5.4.10"
"vite": "^5.4.11"
},
"lint-staged": {
"*.{ts,tsx,js,jsx}": [
Expand Down
25 changes: 14 additions & 11 deletions src/components/PreviewCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,20 @@ function PreviewCard({ selectedData }: PreviewCardProps) {
gap: "10px",
}}
>
<DownloadButton
buttonText="MCAP"
//One file for now -- can make it dynamically read several files at a time
fileName={selectedData.mcap_files[0].file_name}
signedUrl={selectedData.mcap_files[0].signed_url ?? null}
/>
<DownloadButton
buttonText="MAT"
fileName={selectedData.mat_files[0].file_name}
signedUrl={selectedData.mat_files[0].signed_url}
/>
{selectedData.mcap_files.map((item) => (
<DownloadButton
buttonText="MCAP"
fileName={item.file_name}
signedUrl={item.signed_url ?? null}
/>
))}
{selectedData.mat_files.map((item) => (
<DownloadButton
buttonText="MAT"
fileName={item.file_name}
signedUrl={item.signed_url}
/>
))}
</div>
</>
) : (
Expand Down

0 comments on commit f82fd70

Please sign in to comment.