Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ export default function AIModelsPage({
<Navigation
setNavigationTab={setNavigationTab}
options={navigationOptions}
currentValue={navigationTab ?? 'registered'}
/>

{AllAIModels.data?.aiModels.length > 0 ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,23 @@ import { Tab, TabList, Tabs } from 'opub-ui';
export const Navigation = ({
setNavigationTab,
options,
currentValue,
}: {
setNavigationTab: (url: string) => void;
options: Array<{
label: string;
url: string;
selected: boolean;
}>;
currentValue?: string;
}) => {
const handleTabClick = (url: string) => {
setNavigationTab(url);
};

const initialValue = options.find((o) => o.selected)?.url ?? options[0]?.url ?? '';
return (
<div>
<Tabs defaultValue="drafts">
<Tabs defaultValue={currentValue ?? initialValue}>
<TabList fitted border>
{options.map((item, index) => (
<Tab
Expand Down
37 changes: 20 additions & 17 deletions components/RichTextEditor/RichTextEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const RichTextEditor: React.FC<RichTextEditorProps> = ({
);

// Custom image handler to use URLs instead of base64
const imageHandler = function(this: any) {
const imageHandler = function (this: any) {
const url = prompt('Enter image URL:');
if (url) {
const quill = this.quill;
Expand All @@ -53,21 +53,21 @@ const RichTextEditor: React.FC<RichTextEditorProps> = ({
toolbar: readOnly
? false
: {
container: [
[{ header: [1, 2, 3, false] }],
['bold', 'italic', 'underline', 'strike'],
[{ list: 'ordered' }, { list: 'bullet' }],
[{ indent: '-1' }, { indent: '+1' }],
['link', 'image'],
[{ align: [] }],
['clean'],
['preview'], // Custom preview button
],
handlers: {
preview: () => setIsPreview(!isPreview),
image: imageHandler,
},
container: [
[{ header: [1, 2, 3, false] }],
['bold', 'italic', 'underline', 'strike'],
[{ list: 'ordered' }, { list: 'bullet' }],
[{ indent: '-1' }, { indent: '+1' }],
['link', 'image'],
[{ align: [] }],
['clean'],
['preview'], // Custom preview button
],
handlers: {
preview: () => setIsPreview(!isPreview),
image: imageHandler,
},
},
clipboard: {
matchVisual: false,
},
Expand Down Expand Up @@ -96,7 +96,7 @@ const RichTextEditor: React.FC<RichTextEditorProps> = ({
{label}
</label>
)}

{isPreview ? (
<div className="min-h-[200px] rounded-md border border-gray-300 bg-white">
<div className="flex items-center justify-between border-b border-gray-300 bg-gray-50 px-4 py-2">
Expand Down Expand Up @@ -137,7 +137,7 @@ const RichTextEditor: React.FC<RichTextEditorProps> = ({
/>
</div>
)}

{helpText && (
<p className="mt-1 text-sm text-gray-500">{helpText}</p>
)}
Expand Down Expand Up @@ -200,6 +200,9 @@ const RichTextEditor: React.FC<RichTextEditorProps> = ({
align-items: center;
gap: 4px;
}
.rich-text-editor + p {
font-size: 12px;
}

.preview-content {
padding: 0;
Expand Down
2 changes: 2 additions & 0 deletions components/Tour/TourGuide.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ export function TourGuide() {
borderRadius: 'var(--border-radius-md, 8px)',
padding: isMobile ? 16 : 20,
boxShadow: '0 8px 24px rgba(0, 0, 0, 0.15)',
maxHeight: '100vh',
overflowY: 'auto',
},
tooltipContainer: {
textAlign: 'left',
Expand Down