Skip to content

Commit

Permalink
fix: multiple minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ttttonyhe committed Jul 16, 2023
1 parent 5cf63f6 commit 33c061f
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 30 deletions.
10 changes: 5 additions & 5 deletions apps/main/src/components/Card/Book/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ const BookCard = (props: Book) => {
onClick={() => openLink(link)}
className="group flex flex-col dark:bg-gray-800 dark:border-none border rounded-md shadow-sm hover:shadow-md transition-shadow bg-white cursor-pointer w-50 z-40"
>
<div className="flex flex-1 items-center lg:py-0 py-1 justify-center">
<div className="px-4.5 py-4 lg:block hidden">
<div className="flex flex-1 items-center lg:justify-center">
<div className="px-4.5 py-4 flex-shrink-0">
<Image
width={35}
height={52}
Expand All @@ -26,15 +26,15 @@ const BookCard = (props: Book) => {
loading="lazy"
/>
</div>
<div className="lg:group-hover:hidden py-2">
<p className="dark:text-white text-sm lg:text-normal font-medium tracking-wider leading-tight whitespace-nowrap overflow-hidden overflow-ellipsis lg:w-[215px] w-40">
<div className="lg:group-hover:hidden lg:group-hover:w-0 py-2 lg:px-0 pr-4.5 overflow-hidden">
<p className="dark:text-white text-sm lg:text-normal font-medium tracking-wider leading-tight whitespace-nowrap overflow-hidden overflow-ellipsis">
{title}
</p>
<p className="text-gray-500 dark:text-gray-400 lg:text-sm text-xs font-light tracking-wide mt-1 whitespace-nowrap">
{author}
</p>
</div>
<div className="pr-4.5 hidden lg:block lg:group-hover:opacity-100 opacity-0 lg:group-hover:flex-1 transition-opacity ease-in-out duration-300 !line-clamp-3">
<div className="pr-4.5 hidden lg:flex-grow lg:block lg:group-hover:opacity-100 opacity-0 lg:group-hover:flex-1 transition-opacity ease-in-out duration-300 !line-clamp-3">
<p className="lg:group-hover:block hidden text-xs font-medium dark:text-white">
{title}
</p>
Expand Down
2 changes: 1 addition & 1 deletion apps/main/src/components/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ const HeaderComponent = ({ headerRef }: HeaderComponentProps) => {
description: "Link",
icon: "briefCase",
link: {
external: "https://www.linkedin.com/in/lipenghe",
external: "https://www.linkedin.com/in/~lhe",
},
},
{
Expand Down
6 changes: 3 additions & 3 deletions apps/main/src/components/Top/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ export default function Top() {
</a>
<a
target="_blank"
href="https://twitter.com/ttttonyhe"
href="https://www.linkedin.com/in/~lhe"
rel="noreferrer"
>
<Button
type="default"
icon="twitter"
icon="linkedIn"
className="!w-full text-blue-400 text-3 leading-14"
>
<span className="tracking-normal">Twitter</span>
<span className="tracking-normal">LinkedIn</span>
</Button>
</a>
<a target="_blank" href="mailto:tony.hlp@hotmail.com" rel="noreferrer">
Expand Down
6 changes: 1 addition & 5 deletions apps/main/src/store/kbar/sagas/updateKbarToSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@ export default function* updateKbarToSearchSaga() {
yield put(setKbarLoading(true))

// set kbar placeholder
yield put(
setKbarPlaceholder(
"Search articles... (10 most revelant results are returned)"
)
)
yield put(setKbarPlaceholder("Search articles..."))

// stop loading
yield put(setKbarLoading(false))
Expand Down
30 changes: 15 additions & 15 deletions packages/twilight-ui/src/Button/button.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'
import Icon from '../Icon'
import type { ButtonTypes, IconNames } from '../utils/propTypes'
import React from "react"
import Icon from "../Icon"
import type { ButtonTypes, IconNames } from "../utils/propTypes"

interface Props {
/**
Expand Down Expand Up @@ -43,12 +43,12 @@ const Template = ({
<button
type="button"
className={`${
className ? `${className} ` : ''
className ? `${className} ` : ""
}${defaultClassName} effect-pressing`}
{...args}
>
{icon && (
<span className={children ? 'w-6 h-6 mr-1' : 'w-6 h-6'}>
<span className={`w-6 h-6 flex-shrink-0 ${children ? "mr-1" : ""}`}>
<Icon name={icon} />
</span>
)}
Expand All @@ -58,14 +58,14 @@ const Template = ({
}

const Button: React.FC<ButtonProps> = ({
type = 'default',
type = "default",
icon,
className,
children = 'Button',
children = "Button",
...rest
}) => {
switch (type) {
case 'menu-default':
case "menu-default":
return (
<Template
aria-label="menu-default"
Expand All @@ -77,7 +77,7 @@ const Button: React.FC<ButtonProps> = ({
{children}
</Template>
)
case 'primary':
case "primary":
return (
<Template
aria-label="primary"
Expand All @@ -89,7 +89,7 @@ const Button: React.FC<ButtonProps> = ({
{children}
</Template>
)
case 'menu-primary':
case "menu-primary":
return (
<Template
aria-label="menu-primary"
Expand Down Expand Up @@ -117,11 +117,11 @@ const Button: React.FC<ButtonProps> = ({
}

Button.defaultProps = {
type: 'default',
icon: '',
className: '',
children: 'Button',
type: "default",
icon: "",
className: "",
children: "Button",
}
Button.displayName = 'Button'
Button.displayName = "Button"

export default Button
11 changes: 10 additions & 1 deletion packages/twilight-ui/src/Icon/icons.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react'
import React from "react"

const icons = {
rss: (
Expand Down Expand Up @@ -1110,6 +1110,15 @@ const icons = {
/>
</svg>
),
linkedIn: (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="currentColor"
>
<path d="M18.3362 18.339H15.6707V14.1622C15.6707 13.1662 15.6505 11.8845 14.2817 11.8845C12.892 11.8845 12.6797 12.9683 12.6797 14.0887V18.339H10.0142V9.75H12.5747V10.9207H12.6092C12.967 10.2457 13.837 9.53325 15.1367 9.53325C17.8375 9.53325 18.337 11.3108 18.337 13.6245V18.339H18.3362ZM7.00373 8.57475C6.14573 8.57475 5.45648 7.88025 5.45648 7.026C5.45648 6.1725 6.14648 5.47875 7.00373 5.47875C7.85873 5.47875 8.55173 6.1725 8.55173 7.026C8.55173 7.88025 7.85798 8.57475 7.00373 8.57475ZM8.34023 18.339H5.66723V9.75H8.34023V18.339ZM19.6697 3H4.32923C3.59498 3 3.00098 3.5805 3.00098 4.29675V19.7033C3.00098 20.4202 3.59498 21 4.32923 21H19.6675C20.401 21 21.001 20.4202 21.001 19.7033V4.29675C21.001 3.5805 20.401 3 19.6675 3H19.6697Z"></path>
</svg>
),
}

export default icons

0 comments on commit 33c061f

Please sign in to comment.