feat: make logo link to the homepage of the app, rename login btn to connect, remove html entities from post excerpt

This commit is contained in:
MTG2000
2022-07-21 08:15:31 +03:00
parent 7cc990e4e8
commit ec5f81c286
4 changed files with 14 additions and 10 deletions

View File

@@ -373,7 +373,13 @@ const createStory = extendType({
// Preprocess & insert
const htmlBody = marked.parse(body);
const excerpt = htmlBody.replace(/<[^>]+>/g, '').slice(0, 120);
const excerpt = htmlBody
.replace(/<[^>]+>/g, '')
.slice(0, 120)
.replace(/&amp;/g, "&")
.replace(/&#39;/g, "'")
.replace(/&quot;/g, '"')
;
if (id) {
await prisma.story.update({

View File

@@ -40,11 +40,11 @@ export default function NavDesktop() {
return (
<nav className="bg-white flex py-16 px-32 items-center w-full min-w-full">
<a href="https://bolt.fun/">
<Link to="/">
<h2 className="text-h5 font-bold mr-40 lg:mr-64">
<img className='h-40' src={ASSETS.Logo} alt="Bolt fun logo" />
</h2>
</a>
</Link>
<ul className="flex gap-32 xl:gap-64">
<li className="relative">
<Link to={'/products'} className='text-body4 font-bold hover:text-primary-600'>
@@ -192,7 +192,7 @@ export default function NavDesktop() {
:
<Link to='/login' className="font-bold hover:text-primary-800 hover:underline">
Login <FiLogIn />
Connect
</Link>)
}
<div className="relative h-36">

View File

@@ -75,9 +75,9 @@ export default function NavMobile() {
return (
<div className={`${styles.navMobile}`}>
<nav className={`bg-white h-[67px] w-full p-16 px-32 flex justify-between items-center`}>
<a href="https://bolt.fun/">
<Link to="/">
<img className='h-32' src={ASSETS.Logo} alt="Bolt fun logo" />
</a>
</Link>
<div className="ml-auto"></div>
{curUser !== undefined &&
@@ -109,7 +109,7 @@ export default function NavMobile() {
:
<Link to='/login' className="font-bold hover:text-primary-800 hover:underline">
Login
Connect
</Link>)
}
<IconButton className='auto text-2xl w-[50px] h-[50px] hover:bg-gray-200 self-center' onClick={() => toggleDrawerOpen()}>

View File

@@ -18,9 +18,7 @@ export default function AuthorCard({ author }: Props) {
return (
<div className="bg-white p-16 border-2 border-gray-200 rounded-12">
<div className='flex gap-8'>
<Link to={createRoute({ type: 'profile', id: author.id, username: author.name })}>
<Avatar width={48} src={author.avatar} />
</Link>
<div className="overflow-hidden">
<p className={`'text-body4' text-black font-medium overflow-hidden text-ellipsis whitespace-nowrap`}>{trimText(author.name, 333)}</p>
<p className={`text-body6 text-gray-600`}>Joined on {dayjs(author.join_date).format('MMMM DD, YYYY')}</p>