-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added in a temp initial version of the /browse feature
* Updated schema * Refactored a few things * Fix issue with nulling out Grapher that showed up when navigating from /browse to a /[tinyurl] * Added in tooltips and refactored Functions with buttons * Meta description should show notes now in link
- Loading branch information
Showing
27 changed files
with
364 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import Link from 'next/link'; | ||
import * as React from 'react'; | ||
|
||
import Grapher from '../lib/graphtoy'; | ||
import { MyStore } from '../store'; | ||
import GrapherComponent from './GrapherComponent'; | ||
import { tiny_url } from '.prisma/client'; | ||
|
||
interface Props { | ||
grapherList: tiny_url[]; | ||
} | ||
const GrapherComponentList: React.FC<Props> = ({ grapherList }) => { | ||
return ( | ||
<> | ||
{grapherList.map((t) => { | ||
const { id, url, value } = t; | ||
const { formulas, variables, notes } = value as unknown as MyStore; | ||
return ( | ||
<div key={id} style={{ width: 400, height: 400 }}> | ||
<Link href={`/${url}`} passHref> | ||
<a> {url}</a> | ||
</Link> | ||
<div>{notes}</div> | ||
<div> | ||
<GrapherComponent | ||
formulas={formulas} | ||
variables={variables} | ||
grapher={new Grapher()} | ||
extraInit={(grapher) => { | ||
grapher.toggleVisualizer(); | ||
}} | ||
/> | ||
{formulas.map((f) => ( | ||
<div key={f.value}>{f.value}</div> | ||
))} | ||
</div> | ||
</div> | ||
); | ||
})} | ||
</> | ||
); | ||
}; | ||
|
||
export default GrapherComponentList; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,17 @@ | ||
import * as React from 'react'; | ||
import styled from 'styled-components'; | ||
|
||
import { guiBgColor } from '../styles'; | ||
|
||
const Wrapper = styled.div` | ||
background-color: ${guiBgColor}; | ||
padding: 8px; | ||
border-radius: 6px; | ||
margin-bottom: 10px; | ||
`; | ||
interface Props extends React.PropsWithChildren {} | ||
const GuiWindow: React.FC<Props> = ({ children }) => { | ||
return <div>{children}</div>; | ||
return <Wrapper>{children}</Wrapper>; | ||
}; | ||
|
||
export default GuiWindow; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.