Skip to content
Snippets Groups Projects
Commit 4f8e7b74 authored by Liliana Sanfilippo's avatar Liliana Sanfilippo
Browse files

idtext

parent b9dadd2c
No related branches found
No related tags found
No related merge requests found
Pipeline #414851 passed
import { stringToSlug } from "../utils";
export function Hhopp({text}:{text: string}){
const arr = [];
......@@ -25,9 +26,16 @@ export function Hsmoke({text}:{text: string}){
)
}
export function H1({text}:{text: string}){
export function H1({text, id}:{text: string, id?: string}){
var idtext: string;
if (id) {
idtext = id;
}
else{
idtext = stringToSlug(text);
}
return(
<div className="row hone">
<div id={idtext} className="row hone">
<svg width="100%" height="100%">
<text x="0%" y="60%">
{text}
......@@ -38,20 +46,34 @@ export function H1({text}:{text: string}){
}
export function H2({text, id}:{text: string, id: string}){
export function H2({text, id}:{text: string, id?: string}){
var idtext: string;
if (id) {
idtext = id;
}
else{
idtext = stringToSlug(text);
}
return(
<div>
<h2 id={id}>{text}</h2>
<h2 id={idtext}>{text}</h2>
<hr/>
</div>
)
}
export function H3({text, id}:{text: string, id: string}){
export function H3({text, id}:{text: string, id?: string}){
var idtext: string;
if (id) {
idtext = id;
}
else{
idtext = stringToSlug(text);
}
return(
<div>
<h3 id={id}>{text}</h3>
<h3 id={idtext}>{text}</h3>
</div>
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment