Skip to content

Commit

Permalink
Merge pull request #48 from utopia-os/markdown-hint
Browse files Browse the repository at this point in the history
fix(other): markdown hint
  • Loading branch information
antontranelis authored Nov 22, 2024
2 parents f2520f3 + ae9a15b commit d87363f
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 9 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "utopia-ui",
"version": "3.0.26",
"version": "3.0.30",
"description": "Reuseable React Components to build mapping apps for real life communities and networks",
"repository": "https://github.com/utopia-os/utopia-ui",
"homepage:": "https://utopia-os.org/",
Expand Down
34 changes: 34 additions & 0 deletions src/Components/Profile/Subcomponents/MarkdownHint.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { useState } from 'react'

export const MarkdownHint = () => {
const [expended, setExpended] = useState<boolean>(false)
return (
<div
onClick={() => setExpended(true)}
title='Markdown is supported'
className='flex tw-flex-row tw-text-gray-400 tw-cursor-pointer tw-items-center'
>
<svg
aria-hidden='true'
height='16'
viewBox='0 0 16 16'
version='1.1'
width='16'
data-view-component='true'
className='octicon octicon-markdown'
fill='rgb(156 163 175 / var(--tw-text-opacity))'
>
<path d='M14.85 3c.63 0 1.15.52 1.14 1.15v7.7c0 .63-.51 1.15-1.15 1.15H1.15C.52 13 0 12.48 0 11.84V4.15C0 3.52.52 3 1.15 3ZM9 11V5H7L5.5 7 4 5H2v6h2V8l1.5 1.92L7 8v3Zm2.99.5L14.5 8H13V5h-2v3H9.5Z'></path>
</svg>
{expended && (
<a
href='https://www.markdownguide.org/cheat-sheet/#basic-syntax'
target='_blank'
rel='noreferrer'
>
<span className='Button-label tw-ml-1'>Markdown is support</span>{' '}
</a>
)}
</div>
)
}
17 changes: 11 additions & 6 deletions src/Components/Profile/Subcomponents/ProfileTextForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import { TextAreaInput } from '#components/Input'
import { FormState } from '#src/types'
import { getValue } from '#utils/GetValue'

import { MarkdownHint } from './MarkdownHint'

export const ProfileTextForm = ({
state,
setState,
Expand All @@ -33,12 +35,15 @@ export const ProfileTextForm = ({

return (
<div className='tw-h-full tw-flex tw-flex-col tw-mt-4'>
<label
htmlFor='nextAppointment'
className='tw-block tw-text-sm tw-font-medium tw-text-gray-500 tw-mb-1'
>
{heading || 'Text'}:
</label>
<div className='tw-flex tw-justify-between tw-items-center'>
<label
htmlFor='nextAppointment'
className='tw-block tw-text-sm tw-font-medium tw-text-gray-500 tw-mb-1'
>
{heading || 'Text'}:
</label>
<MarkdownHint />
</div>
<TextAreaInput
placeholder={'...'}
defaultValue={getValue(state, field)}
Expand Down

0 comments on commit d87363f

Please sign in to comment.