-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
61 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { useAtom } from 'jotai' | ||
import { atom_notes } from 'jotai/atoms' | ||
|
||
import React, { useRef, useState } from 'react' | ||
import SectionHeading from '../common/SectionHeading.component' | ||
import Textarea from '@/components/forms/input/Textarea' | ||
|
||
type Props = {} | ||
|
||
export default function NotesSection({}: Props) { | ||
const [notes, setNotes] = useAtom(atom_notes) | ||
const [isExpanded, setisExpanded] = useState(true) | ||
const textareaRef = useRef<HTMLTextAreaElement>(null) | ||
|
||
return ( | ||
<section className="mt-8"> | ||
<SectionHeading | ||
title="Notes" | ||
description={ | ||
'Use this space for brainstorming, saving research links, or noting questions that pop up during your session.' | ||
} | ||
subHeading={ | ||
'* Jot down distracting but important thoughts to revisit later.' | ||
} | ||
isExpanded={isExpanded} | ||
handleToggle={() => setisExpanded(!isExpanded)} | ||
/> | ||
{isExpanded && renderTextarea()} | ||
</section> | ||
) | ||
|
||
function renderTextarea() { | ||
return ( | ||
<Textarea | ||
handleChange={handleUpdateField} | ||
ref={textareaRef} | ||
id="taskNotes" | ||
label="Write your notes" | ||
value={notes} | ||
/> | ||
) | ||
} | ||
|
||
function handleUpdateField(value: string) { | ||
setNotes(value) | ||
} | ||
} |
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,3 @@ | ||
import NotesSection from './NotesSections' | ||
|
||
export default NotesSection |
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