-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Solution Explanations #15
Conversation
@malerba118 is attempting to deploy a commit to the Sliphq Team on Vercel. A member of the Team first needs to authorize it. |
@@ -0,0 +1,91 @@ | |||
import React, { FC, HTMLProps, useEffect, useState } from "react"; | |||
|
|||
interface ComplexInputProps<T> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually unused now, but i'm kinda tempted just to leave it in cause i think it's powerful. I was using it for manual array input in my first iteration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool with leavin this in!
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/sliphq/truthy-so/B994H4Fxa98FnKiPYzafwNemgXgi |
> | ||
{steps[FormStep.Explanation]} | ||
</div> | ||
{/* {steps[formStep]} */} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was originally just conditionally rendering these steps like on line 213 here, but then the state for a step would get blown away if you switched to a different step and came back, so i changed it to just set display none on inactive steps to preserve their state
} | ||
|
||
return ( | ||
<EditorContext.Provider value={editor}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I created a little wrapper for the Editor so that the Editor can support children and from the children you can call useEditor to get the editor instance.
This enables support for all sort of interesting children components for the editor. For example:
<Editor>
<LineSelector lines={lines} onChange={setLines} />
<Editor>
<Editor>
<ContentWidget line={5}>
<div>some content pinned to line 5</div>
</ContentWidget>
<Editor>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
love this approach. opens it up for really cool stuff in the future. great thinking :)
|
||
select views from quizzes where id = row_id ; | ||
$function$ | ||
; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In its current state schema.sql actually fails execution on a fresh db. I had to move these alterations down in the script to a point where the quizzes table has already been created.
@@ -0,0 +1,91 @@ | |||
import React, { FC, HTMLProps, useEffect, useState } from "react"; | |||
|
|||
interface ComplexInputProps<T> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool with leavin this in!
Alright, this is a pretty big one, so to summarize this:
Before running this locally be sure to run the new additions to schema.sql against whatever db you're using (sorry that this is not an automated migration, it should be ideally, but not sure it's worth it for a project of this scale)