Skip to content

Commit

Permalink
feat:hidden Event Preview (#254)
Browse files Browse the repository at this point in the history
Signed-off-by: laixingyou <[email protected]>
  • Loading branch information
coder-sett authored Oct 26, 2023
1 parent c2ef084 commit 5e15f69
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ const RepoItem: React.FC<{

return (
<div className="rounded border border-gray-300 px-4 py-3">
<Link href={getShortAnalyzeLink(shortCode)} className="hover:underline">
<Link
href={getShortAnalyzeLink(shortCode)}
target="_blank"
className="hover:underline"
>
<h4 className="line-clamp-2 text-sm font-bold">{name}</h4>
</Link>
<p className="text-xs text-gray-400">{getFirstPathSegment(path)}</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,10 @@ const TrendsList: React.FC = () => {
return (
<tr className="group" key={item!.label}>
<td className="flex flex-col px-1 py-2 ">
<Link href={getShortAnalyzeLink(item!.shortCode)}>
<Link
href={getShortAnalyzeLink(item!.shortCode)}
target="_blank"
>
<p className="break-words text-sm font-bold md:w-[140px]">
{r.name}
{item?.level === Level.COMMUNITY ? (
Expand Down
1 change: 1 addition & 0 deletions apps/web/src/modules/explore/CollectionCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ const CollectionCard = (props: { collection: Collection }) => {
<Link
key={label}
href={getShortAnalyzeLink(shortCode)}
target="_blank"
className="flex w-full items-center text-sm hover:underline"
>
<span className="mr-1 h-1 w-1 flex-shrink-0 bg-black" />
Expand Down
1 change: 1 addition & 0 deletions apps/web/src/modules/explore/CollectionFullCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ const CollectionFullCard = (props: { collection: Collection }) => {
<Link
key={label}
href={getShortAnalyzeLink(shortCode)}
target="_blank"
className="flex w-full items-center text-sm hover:underline"
>
<span className="mr-1 h-1 w-1 flex-shrink-0 bg-black" />
Expand Down
4 changes: 3 additions & 1 deletion apps/web/src/modules/explore/RepoCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ const RepoCard = (props: {
{compareMode ? (
repo
) : (
<Link href={getShortAnalyzeLink(shortCode)}>{repo}</Link>
<Link href={getShortAnalyzeLink(shortCode)} target="_blank">
{repo}
</Link>
)}
</p>
<p className="h-6 truncate text-sm text-gray-400">{nameSpace}</p>
Expand Down
5 changes: 2 additions & 3 deletions apps/web/src/modules/home/Banner/SearchDropdown.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, { useState } from 'react';
import Link from 'next/link';
import classnames from 'classnames';
import { useRouter } from 'next/router';
import { useTranslation, Trans } from 'next-i18next';
import { AiOutlineRightCircle } from 'react-icons/ai';
import useDropDown from '@common/hooks/useDropDown';
Expand Down Expand Up @@ -94,6 +93,7 @@ const LinkItem: React.FC<{
<Link
key={item.label}
href={getShortAnalyzeLink(item)}
target="_blank"
className={classnames(
'flex min-h-[66px] cursor-pointer items-center justify-between px-4 py-3 text-xl hover:bg-gray-100',
'md:py-2 md:px-2 md:text-base',
Expand All @@ -115,12 +115,11 @@ const DropDownList: React.FC<{ result: SearchQuery['fuzzySearch'] }> = ({
result,
}) => {
const { t } = useTranslation();
const router = useRouter();
const { active } = useDropDown({
totalLength: result.length,
onPressEnter: () => {
const activeItem = result[active];
router.push(getShortAnalyzeLink(activeItem));
window.open(getShortAnalyzeLink(activeItem), '_blank');
},
});

Expand Down
1 change: 1 addition & 0 deletions apps/web/src/modules/home/HotFields/ProjectItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const ProjectItem = ({ shortCode, url }) => {
<Link
key={name}
href={getShortAnalyzeLink(shortCode)}
target="_blank"
className="flex cursor-pointer justify-between py-1"
>
<div className="text-sm text-black">
Expand Down
1 change: 1 addition & 0 deletions apps/web/src/modules/home/Trending/ListPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const ListPanel = (props: {
key={item.label}
href={getShortAnalyzeLink(item.shortCode)}
className="grid cursor-pointer grid-cols-6 gap-2 border-b py-3 last:border-0"
target="_blank"
>
<div className="col-span-3 flex">
<div className="relative h-10 w-10">
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const Home: React.FC = (props) => {
<NoSsr>
<Explain />
<ExplainMobile />
<Questionnaire />
{/* <Questionnaire /> */}
</NoSsr>
<SpecialThank />
</main>
Expand Down

2 comments on commit 5e15f69

@vercel
Copy link

@vercel vercel bot commented on 5e15f69 Oct 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 5e15f69 Oct 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.