Skip to content

Commit

Permalink
Merge pull request #25 from YoungerMax/dev
Browse files Browse the repository at this point in the history
Add header block functionality
  • Loading branch information
aodhfionn authored Jul 1, 2023
2 parents 33abfcd + 334dd88 commit 9da9bb1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
15 changes: 15 additions & 0 deletions web/src/components/note/contentblock/headerblock.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.headerblock-header {
font-size: 2em;
border: none;
font-weight: bold;
width: 100%;

padding-bottom: 4px;
border-bottom: 2px solid #888888;
}

.headerblock-header::placeholder {
font-weight: 400;
font-style: italic;
color: #888888;
}
6 changes: 5 additions & 1 deletion web/src/components/note/contentblock/headerblock.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
import { useState } from "react";
import "./contentblock.css"
import "./headerblock.css"

interface HeaderProps {
text: string;
}

export default function HeaderBlock(props: HeaderProps) {
let [ headerText, setHeaderText ] = useState<string>(props.text);

return (
<div className="contentblock">
<h1 className="header">{props.text}</h1>
<input type='text' className="headerblock-header" placeholder="Section header..." value={headerText} onChange={ e => setHeaderText(e.target.value) }/>
</div>
)
}

0 comments on commit 9da9bb1

Please sign in to comment.