/new page responsiveness
This commit is contained in:
parent
563136fdb3
commit
0c20460c13
5 changed files with 24 additions and 10 deletions
|
@ -1,6 +1,12 @@
|
|||
{
|
||||
"extends": ["next/core-web-vitals", "plugin:@typescript-eslint/recommended"],
|
||||
"ignorePatterns": ["node_modules/", "__tests__/"],
|
||||
"ignorePatterns": [
|
||||
"node_modules/",
|
||||
"__tests__/",
|
||||
"coverage/",
|
||||
".next/",
|
||||
"public"
|
||||
],
|
||||
"rules": {
|
||||
"@typescript-eslint/no-unused-vars": "error",
|
||||
"@typescript-eslint/no-explicit-any": "error"
|
||||
|
|
|
@ -42,11 +42,9 @@ export default function DocumentTabs({
|
|||
setActiveTab(newTab as "preview" | "edit")
|
||||
}
|
||||
|
||||
const formattingIconsVisibilityClass =
|
||||
activeTab === "preview" ? "hidden" : "block"
|
||||
return (
|
||||
<Tabs {...props} onValueChange={handleTabChange} defaultValue={defaultTab}>
|
||||
<TabsList className="flex justify-between">
|
||||
<TabsList className="flex flex-col items-start justify-start sm:flex-row sm:items-center sm:justify-between">
|
||||
<div>
|
||||
<TabsTrigger value="edit">{isEditing ? "Edit" : "Raw"}</TabsTrigger>
|
||||
<TabsTrigger value="preview">
|
||||
|
@ -56,7 +54,9 @@ export default function DocumentTabs({
|
|||
{isEditing && (
|
||||
<FormattingIcons
|
||||
textareaRef={codeEditorRef}
|
||||
className={`ml-auto ${formattingIconsVisibilityClass}`}
|
||||
className={`ml-auto ${
|
||||
activeTab === "preview" ? "hidden" : "hidden sm:block"
|
||||
}`}
|
||||
/>
|
||||
)}
|
||||
</TabsList>
|
||||
|
@ -68,6 +68,14 @@ export default function DocumentTabs({
|
|||
flexDirection: "column"
|
||||
}}
|
||||
>
|
||||
<FormattingIcons
|
||||
textareaRef={codeEditorRef}
|
||||
className={`ml-auto ${
|
||||
activeTab === "preview"
|
||||
? "hidden"
|
||||
: "block text-muted-foreground sm:hidden"
|
||||
}`}
|
||||
/>
|
||||
<TextareaMarkdown.Wrapper ref={codeEditorRef}>
|
||||
<Textarea
|
||||
readOnly={!isEditing}
|
||||
|
|
|
@ -33,7 +33,7 @@ const DatePicker = dynamic(
|
|||
"text-muted-foreground"
|
||||
)}
|
||||
>
|
||||
<CalendarIcon className="mr-2 h-4 w-4" />
|
||||
<CalendarIcon className="w-4 h-4 mr-2" />
|
||||
<span>Won't expire</span>
|
||||
</Button>
|
||||
)
|
||||
|
@ -255,7 +255,7 @@ function Post({
|
|||
}
|
||||
|
||||
return (
|
||||
<div className="flex flex-1 flex-col gap-4">
|
||||
<div className="flex flex-col flex-1 gap-4">
|
||||
<Title title={title} onChange={onChangeTitle} className="py-4" />
|
||||
{/* <Description description={description} onChange={onChangeDescription} /> */}
|
||||
<EditDocumentList
|
||||
|
@ -267,7 +267,7 @@ function Post({
|
|||
/>
|
||||
<FileDropzone setDocs={uploadDocs} />
|
||||
|
||||
<div className="mt-4 flex items-center justify-between">
|
||||
<div className="flex flex-col items-end justify-between gap-4 mt-4 sm:flex-row sm:items-center">
|
||||
<span className="flex flex-1 gap-2">
|
||||
<Button
|
||||
onClick={() => {
|
||||
|
|
|
@ -26,7 +26,7 @@ export function DatePicker({
|
|||
!expiresAt && "text-muted-foreground"
|
||||
)}
|
||||
>
|
||||
<CalendarIcon className="mr-2 h-4 w-4" />
|
||||
<CalendarIcon className="w-4 h-4 mr-2" />
|
||||
{expiresAt ? (
|
||||
format(expiresAt, "PPP")
|
||||
) : (
|
||||
|
|
|
@ -15,7 +15,7 @@ export default function Layout({
|
|||
<div className={clsx(styles.page, forSites && styles.forSites)}>
|
||||
<div className="flex flex-col justify-between h-screen">
|
||||
<div> {children}</div>
|
||||
<footer className="h-16 py-4 text-sm text-center text-gray-500">
|
||||
<footer className="mx-auto h-4 max-w-[var(--main-content)] text-center text-sm text-gray-500">
|
||||
<p>
|
||||
Drift is an open source project by{" "}
|
||||
<Link colored href="https://twitter.com/Max_Leiter">
|
||||
|
|
Loading…
Reference in a new issue