Skip to content

Commit

Permalink
api endpoint achieved :prayge:
Browse files Browse the repository at this point in the history
  • Loading branch information
snoglobe committed Mar 28, 2024
1 parent 230bc3a commit b156119
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
13 changes: 7 additions & 6 deletions components/onboard/item.js
@@ -1,6 +1,7 @@
import {Box, Divider, Flex, Heading, Image, Paragraph} from "theme-ui";
import {Link} from "theme-ui";
import React, {useContext} from "react";
import {OBJECT} from "swr/_internal";

function trim(str) {
return str.substring(1, str.length - 1)
Expand Down Expand Up @@ -28,14 +29,14 @@ const Item = ({ title, author_name, author_slack, image, project }) => {
alignItems: 'center'
}}
>
<Image
src={image}
alt={title}
sx={{
<object
data={image}
type={'image/svg+xml'}
style={{
width: '100%',
borderRadius: 8
borderRadius: '8px'
}}
/>
></object>
<Link
href={`/onboard/board/${project.project_name}`}
sx={{
Expand Down
3 changes: 2 additions & 1 deletion pages/api/board/[name].js
Expand Up @@ -24,7 +24,8 @@ export const FetchProject = async (name) => {
/*const thumbnail = await fetch(`https://github.com/snoglobe/OnBoard/raw/main/projects/${name}/thumbnail.png`, {mode: 'no-cors'})*/
/*console.log(thumbnail)*/
const image = /*thumbnail.ok ? `https://github.com/snoglobe/OnBoard/raw/main/projects/${name}/thumbnail.png`
:*/ `data:image/svg+xml;base64,${btoa((await gerberToSvg(`https://github.com/snoglobe/OnBoard/raw/main/projects/${name}/gerber.zip`)).top)}`
:*/ /*`data:image/svg+xml;base64,${btoa((await gerberToSvg(`https://github.com/snoglobe/OnBoard/raw/main/projects/${name}/gerber.zip`)).top)}`*/
`/api/board/svg/${encodeURIComponent(`https://github.com/snoglobe/OnBoard/raw/main/projects/${name}/gerber.zip`)}/top`
console.log("done")
return({
project_name: name ?? null,
Expand Down

0 comments on commit b156119

Please sign in to comment.