Skip to content

Commit

Permalink
Merge branch 'dev' into dev-location
Browse files Browse the repository at this point in the history
  • Loading branch information
Altair59 committed Mar 9, 2024
2 parents 809cbd2 + 27f384e commit 70c2d02
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
10 changes: 5 additions & 5 deletions src/components/input/input-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export function InputForm({
{children}

<motion.div
className='flex border-b border-light-border pb-2 dark:border-dark-border'
className='flex flex-wrap border-b border-light-border pb-2 dark:border-dark-border'
{...fromBottom}
>
{isVisibilityShown && (
Expand All @@ -194,12 +194,12 @@ export function InputForm({
{isLocationShown && location !== '' && (
<button
type='button'
className='custom-button accent-tab accent-bg-tab ml-auto flex items-center gap-1
py-0 px-3 text-main-accent hover:bg-main-accent/10 active:bg-main-accent/20'
className='custom-button accent-tab accent-bg-tab ml-auto flex max-w-[200px] items-center
gap-1 py-0 px-3 text-main-accent hover:bg-main-accent/10 active:bg-main-accent/20'
onClick={onToggleShowLocation}
>
<HeroIcon className='h-4 w-4' iconName='MapPinIcon' />
<p className='font-bold'>{location}</p>
<HeroIcon className='h-4 w-4 flex-shrink-0' iconName='MapPinIcon' />
<p className='truncate font-bold'>{location}</p>
</button>
)}
</motion.div>
Expand Down
3 changes: 2 additions & 1 deletion src/components/input/location-combobox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ const locations = [
'New York, USA',
'Beijing, China',
'Seoul, Korea',
'Toronto, Canada'
'Toronto, Canada',
'Edinburgh of the Seven Seas, Saint Helena, Ascension, and Tristan da Cunha'
];

type LocationComboboxProps = {
Expand Down
8 changes: 4 additions & 4 deletions src/components/tweet/tweet-location.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,18 @@ export function TweetLocation({
<Link href={tweetLink}>
<a
className={cn(
'custom-underline peer whitespace-nowrap',
'custom-underline peer whitespace-pre-line',
viewTweet && 'text-light-secondary dark:text-dark-secondary'
)}
>
{location}
{location.length > 20 ? `${location.slice(0, 20)}...` : location}
</a>
</Link>
</div>

<ToolTip
className='translate-y-1 peer-focus:opacity-100 peer-focus-visible:visible
peer-focus-visible:delay-200'
className='translate-y-1 whitespace-pre-line peer-focus:opacity-100
peer-focus-visible:visible peer-focus-visible:delay-200'
tip={location}
/>
</div>
Expand Down
4 changes: 3 additions & 1 deletion src/lib/date.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ function getFullTime(date: Date): string {
year: 'numeric'
}).format(date);

const splittedDate = fullDate.split(', ');
const splittedDate = fullDate.includes(' at ')
? fullDate.split(' at ')
: fullDate.split(', ');

const formattedDate =
splittedDate.length === 2
Expand Down

0 comments on commit 70c2d02

Please sign in to comment.