| @@ -10,6 +10,7 @@ import MainArea from '@/components/layout/MainArea' | |||||
| import { SITE_TITLE } from '@/config' | import { SITE_TITLE } from '@/config' | ||||
| import { fetchPostChanges } from '@/lib/posts' | import { fetchPostChanges } from '@/lib/posts' | ||||
| import { postsKeys } from '@/lib/queryKeys' | import { postsKeys } from '@/lib/queryKeys' | ||||
| import { cn } from '@/lib/utils' | |||||
| import type { FC } from 'react' | import type { FC } from 'react' | ||||
| @@ -44,7 +45,7 @@ export default (() => { | |||||
| {loading ? 'Loading...' : ( | {loading ? 'Loading...' : ( | ||||
| <> | <> | ||||
| <table className="table-auto w-full border-collapse"> | <table className="table-auto w-full border-collapse"> | ||||
| <thead> | |||||
| <thead className="border-b-2 border-black dark:border-white"> | |||||
| <tr> | <tr> | ||||
| <th className="p-2 text-left">投稿</th> | <th className="p-2 text-left">投稿</th> | ||||
| <th className="p-2 text-left">変更</th> | <th className="p-2 text-left">変更</th> | ||||
| @@ -64,9 +65,12 @@ export default (() => { | |||||
| ++rowsCnt | ++rowsCnt | ||||
| } | } | ||||
| return ( | return ( | ||||
| <tr key={`${ change.timestamp }-${ change.post.id }-${ change.tag.id }`}> | |||||
| <tr key={`${ change.timestamp }-${ change.post.id }-${ change.tag.id }`} | |||||
| className={cn ('even:bg-gray-100 dark:even:bg-gray-700', | |||||
| withPost && 'border-t')}> | |||||
| {withPost && ( | {withPost && ( | ||||
| <td className="align-top" rowSpan={rowsCnt}> | |||||
| <td className="align-top p-2 bg-white dark:bg-[#242424] border-r" | |||||
| rowSpan={rowsCnt}> | |||||
| <PrefetchLink to={`/posts/${ change.post.id }`}> | <PrefetchLink to={`/posts/${ change.post.id }`}> | ||||
| <img src={change.post.thumbnail || change.post.thumbnailBase || undefined} | <img src={change.post.thumbnail || change.post.thumbnailBase || undefined} | ||||
| alt={change.post.title || change.post.url} | alt={change.post.title || change.post.url} | ||||
| @@ -74,11 +78,11 @@ export default (() => { | |||||
| className="w-40"/> | className="w-40"/> | ||||
| </PrefetchLink> | </PrefetchLink> | ||||
| </td>)} | </td>)} | ||||
| <td> | |||||
| <td className="p-2"> | |||||
| <TagLink tag={change.tag} withWiki={false} withCount={false}/> | <TagLink tag={change.tag} withWiki={false} withCount={false}/> | ||||
| {`を${ change.changeType === 'add' ? '記載' : '消除' }`} | {`を${ change.changeType === 'add' ? '記載' : '消除' }`} | ||||
| </td> | </td> | ||||
| <td> | |||||
| <td className="p-2"> | |||||
| {change.user ? ( | {change.user ? ( | ||||
| <PrefetchLink to={`/users/${ change.user.id }`}> | <PrefetchLink to={`/users/${ change.user.id }`}> | ||||
| {change.user.name} | {change.user.name} | ||||
| @@ -2,7 +2,7 @@ import { useEffect, useRef, useState } from 'react' | |||||
| import { Helmet } from 'react-helmet-async' | import { Helmet } from 'react-helmet-async' | ||||
| import TagLink from '@/components/TagLink' | import TagLink from '@/components/TagLink' | ||||
| import SectionTitle from '@/components/common/SectionTitle' | |||||
| import PageTitle from '@/components/common/PageTitle' | |||||
| import TextArea from '@/components/common/TextArea' | import TextArea from '@/components/common/TextArea' | ||||
| import MainArea from '@/components/layout/MainArea' | import MainArea from '@/components/layout/MainArea' | ||||
| import { toast } from '@/components/ui/use-toast' | import { toast } from '@/components/ui/use-toast' | ||||
| @@ -92,13 +92,13 @@ export default ({ user }: Props) => { | |||||
| </Helmet> | </Helmet> | ||||
| <div className="max-w-xl"> | <div className="max-w-xl"> | ||||
| <SectionTitle>ニコニコ連携</SectionTitle> | |||||
| <PageTitle>ニコニコ連携</PageTitle> | |||||
| </div> | </div> | ||||
| <div className="mt-4"> | <div className="mt-4"> | ||||
| {nicoTags.length > 0 && ( | {nicoTags.length > 0 && ( | ||||
| <table className="table-auto w-full border-collapse mb-4"> | <table className="table-auto w-full border-collapse mb-4"> | ||||
| <thead> | |||||
| <thead className="border-b-2 border-black dark:border-white"> | |||||
| <tr> | <tr> | ||||
| <th className="p-2 text-left">ニコニコタグ</th> | <th className="p-2 text-left">ニコニコタグ</th> | ||||
| <th className="p-2 text-left">連携タグ</th> | <th className="p-2 text-left">連携タグ</th> | ||||
| @@ -107,7 +107,7 @@ export default ({ user }: Props) => { | |||||
| </thead> | </thead> | ||||
| <tbody> | <tbody> | ||||
| {nicoTags.map ((tag, i) => ( | {nicoTags.map ((tag, i) => ( | ||||
| <tr key={i}> | |||||
| <tr key={i} className="even:bg-gray-100 dark:even:bg-gray-700"> | |||||
| <td className="p-2"> | <td className="p-2"> | ||||
| <TagLink tag={tag} withWiki={false} withCount={false}/> | <TagLink tag={tag} withWiki={false} withCount={false}/> | ||||
| </td> | </td> | ||||
| @@ -125,7 +125,7 @@ export default ({ user }: Props) => { | |||||
| </span>))} | </span>))} | ||||
| </td> | </td> | ||||
| {memberFlg && ( | {memberFlg && ( | ||||
| <td> | |||||
| <td className="p-2"> | |||||
| <a href="#" onClick={ev => { | <a href="#" onClick={ev => { | ||||
| ev.preventDefault () | ev.preventDefault () | ||||
| handleEdit (tag.id) | handleEdit (tag.id) | ||||
| @@ -3,6 +3,7 @@ import { Helmet } from 'react-helmet-async' | |||||
| import { useLocation } from 'react-router-dom' | import { useLocation } from 'react-router-dom' | ||||
| import PrefetchLink from '@/components/PrefetchLink' | import PrefetchLink from '@/components/PrefetchLink' | ||||
| import PageTitle from '@/components/common/PageTitle' | |||||
| import MainArea from '@/components/layout/MainArea' | import MainArea from '@/components/layout/MainArea' | ||||
| import { SITE_TITLE } from '@/config' | import { SITE_TITLE } from '@/config' | ||||
| import { apiGet } from '@/lib/api' | import { apiGet } from '@/lib/api' | ||||
| @@ -28,8 +29,11 @@ export default () => { | |||||
| <Helmet> | <Helmet> | ||||
| <title>{`Wiki 変更履歴 | ${ SITE_TITLE }`}</title> | <title>{`Wiki 変更履歴 | ${ SITE_TITLE }`}</title> | ||||
| </Helmet> | </Helmet> | ||||
| <PageTitle>Wiki 履歴</PageTitle> | |||||
| <table className="table-auto w-full border-collapse"> | <table className="table-auto w-full border-collapse"> | ||||
| <thead> | |||||
| <thead className="border-b-2 border-black dark:border-white"> | |||||
| <tr> | <tr> | ||||
| <th></th> | <th></th> | ||||
| <th className="p-2 text-left">タイトル</th> | <th className="p-2 text-left">タイトル</th> | ||||
| @@ -39,8 +43,8 @@ export default () => { | |||||
| </thead> | </thead> | ||||
| <tbody> | <tbody> | ||||
| {changes.map (change => ( | {changes.map (change => ( | ||||
| <tr key={change.revisionId}> | |||||
| <td> | |||||
| <tr key={change.revisionId} className="even:bg-gray-100 dark:even:bg-gray-700"> | |||||
| <td className="p-2"> | |||||
| {change.pred != null && ( | {change.pred != null && ( | ||||
| <PrefetchLink | <PrefetchLink | ||||
| to={`/wiki/${ change.wikiPage.id }/diff?from=${ change.pred }&to=${ change.revisionId }`}> | to={`/wiki/${ change.wikiPage.id }/diff?from=${ change.pred }&to=${ change.revisionId }`}> | ||||
| @@ -2,7 +2,7 @@ import { useEffect, useState } from 'react' | |||||
| import { Helmet } from 'react-helmet-async' | import { Helmet } from 'react-helmet-async' | ||||
| import PrefetchLink from '@/components/PrefetchLink' | import PrefetchLink from '@/components/PrefetchLink' | ||||
| import SectionTitle from '@/components/common/SectionTitle' | |||||
| import PageTitle from '@/components/common/PageTitle' | |||||
| import MainArea from '@/components/layout/MainArea' | import MainArea from '@/components/layout/MainArea' | ||||
| import { SITE_TITLE } from '@/config' | import { SITE_TITLE } from '@/config' | ||||
| import { apiGet } from '@/lib/api' | import { apiGet } from '@/lib/api' | ||||
| @@ -35,8 +35,9 @@ export default () => { | |||||
| <Helmet> | <Helmet> | ||||
| <title>Wiki | {SITE_TITLE}</title> | <title>Wiki | {SITE_TITLE}</title> | ||||
| </Helmet> | </Helmet> | ||||
| <div className="max-w-xl"> | <div className="max-w-xl"> | ||||
| <SectionTitle>Wiki</SectionTitle> | |||||
| <PageTitle>Wiki</PageTitle> | |||||
| <form onSubmit={handleSearch} className="space-y-2"> | <form onSubmit={handleSearch} className="space-y-2"> | ||||
| {/* タイトル */} | {/* タイトル */} | ||||
| <div> | <div> | ||||
| @@ -68,7 +69,7 @@ export default () => { | |||||
| <div className="mt-4"> | <div className="mt-4"> | ||||
| <table className="table-auto w-full border-collapse"> | <table className="table-auto w-full border-collapse"> | ||||
| <thead> | |||||
| <thead className="border-b-2 border-black dark:border-white"> | |||||
| <tr> | <tr> | ||||
| <th className="p-2 text-left">タイトル</th> | <th className="p-2 text-left">タイトル</th> | ||||
| <th className="p-2 text-left">最終更新</th> | <th className="p-2 text-left">最終更新</th> | ||||
| @@ -76,13 +77,13 @@ export default () => { | |||||
| </thead> | </thead> | ||||
| <tbody> | <tbody> | ||||
| {results.map (page => ( | {results.map (page => ( | ||||
| <tr key={page.id}> | |||||
| <tr key={page.id} className="even:bg-gray-100 dark:even:bg-gray-700"> | |||||
| <td className="p-2"> | <td className="p-2"> | ||||
| <PrefetchLink to={`/wiki/${ encodeURIComponent (page.title) }`}> | <PrefetchLink to={`/wiki/${ encodeURIComponent (page.title) }`}> | ||||
| {page.title} | {page.title} | ||||
| </PrefetchLink> | </PrefetchLink> | ||||
| </td> | </td> | ||||
| <td className="p-2 text-gray-100 text-sm"> | |||||
| <td className="p-2"> | |||||
| {page.updatedAt} | {page.updatedAt} | ||||
| </td> | </td> | ||||
| </tr>))} | </tr>))} | ||||