Skip to content

Commit

Permalink
Merge pull request #522 from open-sauced/beta
Browse files Browse the repository at this point in the history
main <- v2.37.0-beta.3
  • Loading branch information
bdougie committed Apr 13, 2024
2 parents 23e70c9 + 45292fb commit 901466a
Show file tree
Hide file tree
Showing 20 changed files with 129 additions and 364 deletions.
4 changes: 2 additions & 2 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ module.exports = {
"arrow-spacing": "error",
"block-spacing": ["error", "always"],
"brace-style": ["error", "1tbs"],
"comma-dangle": ["error", "always-multiline"],
"comma-dangle": ["warn", "always-multiline"],
"comma-spacing": [
"error",
{
Expand Down Expand Up @@ -216,7 +216,7 @@ module.exports = {
"no-trailing-spaces": "error",
"no-whitespace-before-property": "error",
"object-curly-newline": [
"error",
"warn",
{
multiline: true,
},
Expand Down
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,27 @@

> All notable changes to this project will be documented in this file
## [2.37.0-beta.3](https://github.com/open-sauced/hot/compare/v2.37.0-beta.2...v2.37.0-beta.3) (2024-04-13)


### 🍕 Features

* working hotlist with needed cleanup ([#521](https://github.com/open-sauced/hot/issues/521)) ([69ba683](https://github.com/open-sauced/hot/commit/69ba68380d2aee66274e17543effbd3cfd63350a))

## [2.37.0-beta.2](https://github.com/open-sauced/hot/compare/v2.37.0-beta.1...v2.37.0-beta.2) (2024-04-13)


### 🍕 Features

* Update robots.txt ([73afcf6](https://github.com/open-sauced/hot/commit/73afcf6e9a3b314472d5c8feea0bf5d4e59e9831))

## [2.37.0-beta.1](https://github.com/open-sauced/hot/compare/v2.36.0...v2.37.0-beta.1) (2024-04-01)


### 🍕 Features

* Use OpenSauced links instead of GitHub ([#520](https://github.com/open-sauced/hot/issues/520)) ([6581b9e](https://github.com/open-sauced/hot/commit/6581b9e130ac9f38c08e1c87f4ffa0cb5cc80648))

## [2.36.0](https://github.com/open-sauced/hot/compare/v2.35.0...v2.36.0) (2024-04-01)


Expand Down
4 changes: 2 additions & 2 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@open-sauced/hot",
"description": "🍕The site that recommends the hottest sauce.",
"keywords": [],
"version": "2.36.0",
"version": "2.37.0-beta.3",
"author": "TED Vortex <ted.vortex@gmail.com>",
"private": true,
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion public/diagram.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions public/robots.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# https://www.robotstxt.org/robotstxt.html
# Allow all crawlers
User-agent: *
Disallow:
Allow: /
26 changes: 2 additions & 24 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,14 @@ import Footer from "./components/Footer";
import PrimaryNav from "./components/PrimaryNav";
import RepoListWrap from "./components/RepoListWrap";
import { initiatePostHog } from "./lib/analytics";
import { BrowserRouter, Route, Routes } from "react-router-dom";
import { BrowserRouter } from "react-router-dom";
import { Toaster } from "react-hot-toast";
import { SWRConfig } from "swr";
import GradBackground from "./components/GradBackground";
import Hero from "./components/Hero";
import apiFetcher from "./hooks/useSWR";

import getAppVersion from "./lib/appVersion";
import RecentRepoListWrap from "./components/RecentRepoListWrap";
import SecondaryNav from "./components/SecondaryNav";
import HotRepositories from "./components/HotRepositories";

console.log(
`%c
Expand Down Expand Up @@ -47,26 +44,7 @@ const App = (): JSX.Element => {
</GradBackground>

<div className="bg-darkestGrey">
<SecondaryNav />

<HotRepositories />

<Routes>
<Route
element={<RecentRepoListWrap />}
path="/"
/>

<Route
element={<RecentRepoListWrap />}
path="recent"
/>

<Route
element={<RepoListWrap />}
path="*"
/>
</Routes>
<RepoListWrap />
</div>

<Footer />
Expand Down
26 changes: 19 additions & 7 deletions src/components/Hero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,27 @@ const Hero = () => {
<div>
<h1 className="font-Lexend text-4xl md:text-5xl text-center text-lightSlate leading-tight tracking-tight">
{`Find `}

<span className="bg-gradient-to-r from-gradFirst via-gradMiddle to-gradLast bg-clip-text text-transparent">
Open-Source Repositories
</span>

<br />
to contribute today
</h1>
</div>

<Combobox as="div" value={comboBoxSelection} onChange={setComboBoxSelection}>
<Combobox
as="div"
value={comboBoxSelection}
onChange={setComboBoxSelection}
>
<div className="mt-11 px-4 py-2.5 bg-white shadow-2xl rounded-2xl md:min-w-[26.375rem] flex justify-between">
<div className="flex items-center gap-x-2.5">
<img alt="search icon" src={searchNormal} />
<img
alt="search icon"
src={searchNormal}
/>

<Combobox.Button ref={comboButtonRef}>
<Combobox.Input
Expand All @@ -78,13 +87,12 @@ const Hero = () => {
placeholder="Search repositories"
type="text"
value={searchTerm}
onChange={(e) => setValueDebounced(e.target.value)}
onChange={e => setValueDebounced(e.target.value)}
onFocus={() => setFocus(true)}
onBlur={() =>
setTimeout(() => {
setFocus(false);
}, 200)
}
}, 200)}
onKeyUp={(event: React.KeyboardEvent) => {
if (event.key === "Enter") {
window.open(comboBoxSelection, "_blank", "noreferrer");
Expand All @@ -94,7 +102,11 @@ const Hero = () => {
</Combobox.Button>
</div>

<img alt="command k" className="pt-1.5" src={cmdKIcon} />
<img
alt="command k"
className="pt-1.5"
src={cmdKIcon}
/>
</div>

<div className="mt-2.5">
Expand All @@ -105,7 +117,7 @@ const Hero = () => {
<p className="text-gray-500 text-sm font-semibold">Repository</p>
</div>

{fetchedData.map((data) => (
{fetchedData.map(data => (
<Combobox.Option
key={data.full_name}
as="a"
Expand Down
57 changes: 15 additions & 42 deletions src/components/HotRepoCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ import Skeleton from "react-loading-skeleton";
import { getAvatarLink } from "../lib/github";
import humanizeNumber from "../lib/humanizeNumber";

import StackedAvatar from "./StackedAvatar";
import useRepo from "../hooks/useRepo";
import useContributions from "../hooks/useContributions";

const bugReportLink = "https://github.com/open-sauced/hot/issues/new?assignees=&title=fix:";

Expand All @@ -17,7 +15,6 @@ export declare interface HotRepoCardProps {

const HotRepoCard = ({ repoName }: HotRepoCardProps): JSX.Element => {
const { repo, isLoading, isError } = useRepo(repoName);
const { data: contributions } = useContributions(repoName);

if (isError) {
return (
Expand All @@ -30,7 +27,7 @@ const HotRepoCard = ({ repoName }: HotRepoCardProps): JSX.Element => {
rel="noreferrer"
target="_blank"
href={`${String(
`${bugReportLink} repo not found [${repoName}]&body=Please take a look why this ${repoName} not founded`,
`${bugReportLink} repo not found [${repoName}]&body=Please take a look why this ${repoName} not founded`

Check warning on line 30 in src/components/HotRepoCard.tsx

View workflow job for this annotation

GitHub Actions / Test and lint / Code standards

Missing trailing comma
)}`}
>
Report a bug
Expand All @@ -43,10 +40,7 @@ const HotRepoCard = ({ repoName }: HotRepoCardProps): JSX.Element => {
if (isLoading) {
return (
<div className="p-4 border rounded-2xl bg-white w-full space-y-1 relative">
<Skeleton
enableAnimation
count={5}
/>
<Skeleton enableAnimation count={5} />

Check warning on line 43 in src/components/HotRepoCard.tsx

View workflow job for this annotation

GitHub Actions / Test and lint / Code standards

Prop `count` must be placed on a new line
</div>
);
}
Expand All @@ -58,68 +52,47 @@ const HotRepoCard = ({ repoName }: HotRepoCardProps): JSX.Element => {
<div className="p-4 border rounded-2xl bg-white w-full space-y-1 relative">
<div className="flex justify-between w-full">
<div className="flex space-x-1 items-center">
<img
alt="Hot Repo Icon"
className="h-4 w-4 rounded-md overflow-hidden"
src={getAvatarLink(owner)}
/>

<span className="text-sm font-medium text-lightSlate11">
{owner}
</span>
<img alt="Hot Repo Icon" className="h-4 w-4 rounded-md overflow-hidden" src={getAvatarLink(owner)} />

Check warning on line 55 in src/components/HotRepoCard.tsx

View workflow job for this annotation

GitHub Actions / Test and lint / Code standards

Prop `className` must be placed on a new line

<span className="text-sm font-medium text-lightSlate11">{owner}</span>

Check warning on line 57 in src/components/HotRepoCard.tsx

View workflow job for this annotation

GitHub Actions / Test and lint / Code standards

`{owner}` must be placed on a new line
</div>
</div>

<div className="flex flex-col pb-10">
<a
className="text-xl font-semibold"
href={`https://insights.opensauced.pizza/hot/repositories/filter/${full_name}`}
href={`https://app.opensauced.pizza/s/${full_name}`}
rel="noopener noreferrer"
target="_blank"
>
{name}
</a>

<p className="text-gray-500 font-medium text-xs w-5/6">
{description}
</p>
<p className="text-gray-500 font-medium text-xs w-5/6">{description}</p>

Check warning on line 71 in src/components/HotRepoCard.tsx

View workflow job for this annotation

GitHub Actions / Test and lint / Code standards

`{description}` must be placed on a new line
</div>

<div className="flex items-center justify-between absolute bottom-3 inset-x-0 px-4">
<div className="flex space-x-3 text-xs">
<div className="flex text-sm space-x-1 justify-center items-center">
<VscIssues
className="fill-lightSlate10"
size={16}
/>

<span className="text-lightSlate11">
{humanizeNumber(issues)}
</span>
<VscIssues className="fill-lightSlate10" size={16} />

Check warning on line 77 in src/components/HotRepoCard.tsx

View workflow job for this annotation

GitHub Actions / Test and lint / Code standards

Prop `size` must be placed on a new line

<span className="text-lightSlate11">{humanizeNumber(issues)}</span>

Check warning on line 79 in src/components/HotRepoCard.tsx

View workflow job for this annotation

GitHub Actions / Test and lint / Code standards

`{humanizeNumber(issues)}` must be placed on a new line
</div>

<div className="flex text-sm space-x-1 justify-center items-center">
<AiOutlineStar
className="fill-lightSlate10"
size={16}
/>

<span className="text-lightSlate11">
{humanizeNumber(stars)}
</span>
<AiOutlineStar className="fill-lightSlate10" size={16} />

Check warning on line 83 in src/components/HotRepoCard.tsx

View workflow job for this annotation

GitHub Actions / Test and lint / Code standards

Prop `size` must be placed on a new line

<span className="text-lightSlate11">{humanizeNumber(stars)}</span>

Check warning on line 85 in src/components/HotRepoCard.tsx

View workflow job for this annotation

GitHub Actions / Test and lint / Code standards

`{humanizeNumber(stars)}` must be placed on a new line
</div>

<div className="flex text-sm space-x-1 justify-center items-center">
<BiGitPullRequest
className="fill-lightSlate10"
size={16}
/>
<BiGitPullRequest className="fill-lightSlate10" size={16} />

Check warning on line 89 in src/components/HotRepoCard.tsx

View workflow job for this annotation

GitHub Actions / Test and lint / Code standards

Prop `size` must be placed on a new line

<span className="text-lightSlate11">0</span>
</div>
</div>

<StackedAvatar contributors={contributions} />
{/* <StackedAvatar contributors={contributions} /> */}
</div>
</div>
);
Expand Down
25 changes: 3 additions & 22 deletions src/components/ListRepositories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,11 @@ import Skeleton from "react-loading-skeleton";

export declare interface ListRepositoriesProps {
activeLink: string | null;
handleLoadingMore: () => void;
fetchedData: DbRepo[];
title: string;
hasNextPage: boolean;
}

const ListRepositories = ({
activeLink,
handleLoadingMore,
fetchedData,
title,
hasNextPage,
}: ListRepositoriesProps): JSX.Element => {
const ListRepositories = ({ activeLink, fetchedData, title }: ListRepositoriesProps): JSX.Element => {
if (!fetchedData.length) {
return (
<div className="mx-auto max-w-7xl px-4 mt-10">
Expand All @@ -32,7 +24,7 @@ const ListRepositories = ({
}

return (
<div className="mx-auto max-w-7xl px-4 pb-1 mt-10">
<div className="mx-auto max-w-7xl px-4 pb-1 pt-10">
<div className="flex flex-col gap-y-5 mb-12">
<div className="flex items-center gap-x-2.5">
<BsFillCalendar2Fill className="w-8 h-8 text-white" />
Expand All @@ -41,20 +33,9 @@ const ListRepositories = ({
</div>

{fetchedData.map((item, i) => (
<RepoList key={`${item.full_name}_${i}`} data={item} />
<RepoList key={`${item.repo_name}_${i}`} data={item} />
))}
</div>

{fetchedData.length > 0 && hasNextPage && (
<div className="flex justify-center">
<button
className="bg-white text-gray-700 mt-4 mb-4 text-base border-gray-400 border font-normal py-1 px-4 rounded"
onClick={() => handleLoadingMore()}
>
Load More
</button>
</div>
)}
</div>
);
};
Expand Down
Loading

0 comments on commit 901466a

Please sign in to comment.