From 545e8460061e1bc38a7ff3f2cea07e3db99c0696 Mon Sep 17 00:00:00 2001 From: Sam Chau Date: Sat, 18 Jan 2025 14:56:37 +1030 Subject: [PATCH] style: enhance ProfileGeneralTab and MarkdownEditor with improved UI components and styles --- .../components/profile/ProfileGeneralTab.jsx | 33 +++++++++++----- frontend/src/components/ui/MarkdownEditor.jsx | 38 +++++++++++++------ frontend/src/components/ui/TextArea.jsx | 2 +- frontend/tailwind.config.js | 7 +++- 4 files changed, 56 insertions(+), 24 deletions(-) diff --git a/frontend/src/components/profile/ProfileGeneralTab.jsx b/frontend/src/components/profile/ProfileGeneralTab.jsx index c0b60dc..4e360fe 100644 --- a/frontend/src/components/profile/ProfileGeneralTab.jsx +++ b/frontend/src/components/profile/ProfileGeneralTab.jsx @@ -1,6 +1,7 @@ import React, {useState} from 'react'; import PropTypes from 'prop-types'; import MarkdownEditor from '@ui/MarkdownEditor'; +import AddButton from '@ui/DataBar/AddButton'; const ProfileGeneralTab = ({ name, @@ -79,7 +80,7 @@ const ProfileGeneralTab = ({ onChange={e => onNameChange(e.target.value)} placeholder='Enter profile name' className='w-full rounded-md border border-gray-300 dark:border-gray-600 - bg-white dark:bg-gray-700 px-3 py-2 text-sm + bg-white dark:bg-gray-800 px-3 py-2 text-sm text-gray-900 dark:text-gray-100 placeholder-gray-500 dark:placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent @@ -122,31 +123,38 @@ const ProfileGeneralTab = ({ onKeyPress={handleKeyPress} placeholder='Add a tag' className='w-full rounded-md border border-gray-300 dark:border-gray-600 - bg-white dark:bg-gray-700 px-3 py-2 text-sm + bg-white dark:bg-gray-800 px-3 py-2 text-sm text-gray-900 dark:text-gray-100 placeholder-gray-500 dark:placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-colors duration-200' /> - + label='Add' + /> {tags.length > 0 ? (
{tags.map(tag => ( + className='inline-flex items-center px-2.5 py-1 rounded-md + text-xs font-semibold + bg-blue-600/20 text-blue-400 + group'> {tag}
) : ( -
+
No tags added yet
)} diff --git a/frontend/src/components/ui/MarkdownEditor.jsx b/frontend/src/components/ui/MarkdownEditor.jsx index f02a0d4..3dc9f80 100644 --- a/frontend/src/components/ui/MarkdownEditor.jsx +++ b/frontend/src/components/ui/MarkdownEditor.jsx @@ -86,9 +86,7 @@ const MarkdownEditor = ({value, onChange, placeholder}) => { {isPreview ? (
- - Preview Mode - + Preview
) : ( controls.map(control => ( @@ -106,18 +104,34 @@ const MarkdownEditor = ({value, onChange, placeholder}) => {
diff --git a/frontend/src/components/ui/TextArea.jsx b/frontend/src/components/ui/TextArea.jsx index 09e0826..6b3ab63 100644 --- a/frontend/src/components/ui/TextArea.jsx +++ b/frontend/src/components/ui/TextArea.jsx @@ -3,7 +3,7 @@ const Textarea = React.forwardRef(({className, ...props}, ref) => { return (