Skip to content

Commit

Permalink
chore: release 1.56.0 (#1383)
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonroberts committed Jul 17, 2023
2 parents 3305396 + a4a4867 commit 325d69e
Show file tree
Hide file tree
Showing 53 changed files with 19,856 additions and 22,476 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": ["next/core-web-vitals", "prettier"],
"extends": ["next/core-web-vitals", "prettier", "plugin:storybook/recommended"],
"plugins": ["unused-imports"],
"rules": {
"quotes": "error",
Expand Down
32 changes: 10 additions & 22 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,20 @@
module.exports = {
"stories": [
"../stories/**/*.stories.mdx",
"../stories/**/*.stories.@(js|jsx|ts|tsx)"
],
"addons": [
stories: ["../stories/**/*.stories.mdx", "../stories/**/*.stories.@(js|jsx|ts|tsx)"],
addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-interactions",
"@storybook/addon-a11y",
"storybook-addon-next",
{
// From stack-overflow answer: https://stackoverflow.com/a/68757745
name: '@storybook/addon-postcss',
name: "@storybook/addon-styling",
options: {
cssLoaderOptions: {
// When you have splitted your css over multiple files
// and use @import('./other-styles.css')
importLoaders: 1,
},
postcssLoaderOptions: {
// When using postCSS 8
implementation: require('postcss'),
},
postCss: true,
},
},
],
"framework": "@storybook/react",
"core": {
"builder": "@storybook/builder-webpack5"
}
}
framework: "@storybook/nextjs",
options: {},
docs: {
autodocs: true,
},
};
85 changes: 85 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,91 @@

> All notable changes to this project will be documented in this file
## [1.56.0-beta.12](https://github.com/open-sauced/insights/compare/v1.56.0-beta.11...v1.56.0-beta.12) (2023-07-17)


### 🍕 Features

* add top contributors panel to feeds page ([#1347](https://github.com/open-sauced/insights/issues/1347)) ([5b58dd5](https://github.com/open-sauced/insights/commit/5b58dd532ff495fa921053ee1bb48eef2544d678))

## [1.56.0-beta.11](https://github.com/open-sauced/insights/compare/v1.56.0-beta.10...v1.56.0-beta.11) (2023-07-17)


### 🎨 Styles

* text inputs colors were not consistent in the user settings page ([#1360](https://github.com/open-sauced/insights/issues/1360)) ([edae9c4](https://github.com/open-sauced/insights/commit/edae9c4a26bbc21921422356c623f2a8c0ca0939))

## [1.56.0-beta.10](https://github.com/open-sauced/insights/compare/v1.56.0-beta.9...v1.56.0-beta.10) (2023-07-17)


### 🐛 Bug Fixes

* prevent concurrent user profile update requests ([#1372](https://github.com/open-sauced/insights/issues/1372)) ([b23b9df](https://github.com/open-sauced/insights/commit/b23b9df076596b7d5163ef9f8d7bc7f28ecde92a))

## [1.56.0-beta.9](https://github.com/open-sauced/insights/compare/v1.56.0-beta.8...v1.56.0-beta.9) (2023-07-14)


### 🐛 Bug Fixes

* improve loading performance of individual highlight ([#1349](https://github.com/open-sauced/insights/issues/1349)) ([9e193fe](https://github.com/open-sauced/insights/commit/9e193feae32739894051ec9d3236826cb00a1c88))

## [1.56.0-beta.8](https://github.com/open-sauced/insights/compare/v1.56.0-beta.7...v1.56.0-beta.8) (2023-07-14)


### 🍕 Features

* added new topics to the list ([#1357](https://github.com/open-sauced/insights/issues/1357)) ([33f03bb](https://github.com/open-sauced/insights/commit/33f03bb53b82e8bb18e49c7e5ccba80c77ab982d))

## [1.56.0-beta.7](https://github.com/open-sauced/insights/compare/v1.56.0-beta.6...v1.56.0-beta.7) (2023-07-12)


### 🐛 Bug Fixes

* add hidden form for Netlify forms submission ([#1351](https://github.com/open-sauced/insights/issues/1351)) ([8075012](https://github.com/open-sauced/insights/commit/80750124072a742443a89716f9b2e956f7bdcb25))

## [1.56.0-beta.6](https://github.com/open-sauced/insights/compare/v1.56.0-beta.5...v1.56.0-beta.6) (2023-07-12)


### 🍕 Features

* changed the last commit date icon with a calender ([#1350](https://github.com/open-sauced/insights/issues/1350)) ([2ae9d53](https://github.com/open-sauced/insights/commit/2ae9d5330e9231d108a9a20b458aed5398c7d24c))

## [1.56.0-beta.5](https://github.com/open-sauced/insights/compare/v1.56.0-beta.4...v1.56.0-beta.5) (2023-07-11)


### 🍕 Features

* add force login component to design system ([#1330](https://github.com/open-sauced/insights/issues/1330)) ([9d68ffc](https://github.com/open-sauced/insights/commit/9d68ffcef1bbd2f17f05492d1b4e9d4ce4263de4))
* implement featured highlights list ([#1337](https://github.com/open-sauced/insights/issues/1337)) ([ed32594](https://github.com/open-sauced/insights/commit/ed32594c64dc616e57e7b9fbea299ba4584bdb68))

## [1.56.0-beta.4](https://github.com/open-sauced/insights/compare/v1.56.0-beta.3...v1.56.0-beta.4) (2023-07-10)


### 🍕 Features

* change position of visibility action component ([#1331](https://github.com/open-sauced/insights/issues/1331)) ([f3f615c](https://github.com/open-sauced/insights/commit/f3f615caf3b8a69943d6b1443ac0b35075501b4b))

## [1.56.0-beta.3](https://github.com/open-sauced/insights/compare/v1.56.0-beta.2...v1.56.0-beta.3) (2023-07-10)


### 🍕 Features

* implement newsletter submission functionality ([#1332](https://github.com/open-sauced/insights/issues/1332)) ([d996ac7](https://github.com/open-sauced/insights/commit/d996ac714fa2cf6394416fcb542c278634edc394))

## [1.56.0-beta.2](https://github.com/open-sauced/insights/compare/v1.56.0-beta.1...v1.56.0-beta.2) (2023-07-10)


### 🐛 Bug Fixes

* ensure font color of selected interests pill changed is white ([#1342](https://github.com/open-sauced/insights/issues/1342)) ([b778f11](https://github.com/open-sauced/insights/commit/b778f11484d02b4d159fe3cd22f43de4a5c28196))

## [1.56.0-beta.1](https://github.com/open-sauced/insights/compare/v1.55.0...v1.56.0-beta.1) (2023-07-06)


### 🍕 Features

* upgrade to Next 13.4, Supabase helper libs to 0.7.x ([#1301](https://github.com/open-sauced/insights/issues/1301)) ([26876c2](https://github.com/open-sauced/insights/commit/26876c260546815102ac5584c0579e12b1323361))

## [1.55.0](https://github.com/open-sauced/insights/compare/v1.54.0...v1.55.0) (2023-07-06)


Expand Down
11 changes: 6 additions & 5 deletions components/atoms/Button/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ export interface ButtonsProps extends React.ButtonHTMLAttributes<HTMLButtonEleme
variant: "primary" | "default" | "dark" | "outline" | "link" | "text";
loading?: boolean;
href?: string;
showLoadingText?: boolean;
}

const Button = React.forwardRef<HTMLElement, ButtonsProps>(
({ className, children, loading, disabled, href, ...props }, ref) => {
({ className, children, loading, disabled, showLoadingText = true, href, ...props }, ref) => {
const styles = {
primary: `bg-light-orange-9 text-light-orange-2 border-light-orange-9 hover:bg-light-orange-10 ${
disabled ? "bg-light-orange-7 hover:bg-light-orange-7 border-none pointer-events-none" : ""
Expand All @@ -26,22 +27,22 @@ const Button = React.forwardRef<HTMLElement, ButtonsProps>(
};

const rootClass = clsx(
className,
props.variant === "primary" && styles.primary,
props.variant === "default" && styles.default,
props.variant === "dark" && styles.dark,
props.variant === "outline" && styles.outline,
props.variant === "link" && styles.link,
disabled && "bg-light-orange-7 hover:bg-light-orange-7 border-none pointer-events-none",
"inline-flex text-sm font-semibold tracking-tight border py-2 px-4 rounded-md focus-visible:border-orange-500 focus:outline-none focus-visible:ring focus-visible:ring-orange-200 whitespace-nowrap"
"inline-flex text-sm font-semibold tracking-tight border py-2 px-4 rounded-md focus-visible:border-orange-500 focus:outline-none focus-visible:ring focus-visible:ring-orange-200 whitespace-nowrap",
className
);

const content = loading ? (
<div>
<svg
aria-hidden="true"
role="status"
className="inline w-4 h-4 mr-3 text-white animate-spin"
className={clsx("inline w-4 h-4 text-white animate-spin", showLoadingText ? "mr-2" : "")}
viewBox="0 0 100 101"
fill="none"
xmlns="http://www.w3.org/2000/svg"
Expand All @@ -55,7 +56,7 @@ const Button = React.forwardRef<HTMLElement, ButtonsProps>(
fill="currentColor"
></path>
</svg>
Loading...
{showLoadingText && <span>Loading...</span>}
</div>
) : (
children
Expand Down
8 changes: 7 additions & 1 deletion components/atoms/LanguagePill/LanguagePill.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import TypeScriptIcon from "/img/icons/interests/typescript.svg";
import RubyIcon from "/img/icons/interests/ruby.svg";
import JavaIcon from "/img/icons/interests/java.svg";
import GolangIcon from "img/icons/interests/golang.svg";
import VueIcon from "img/icons/interests/vuejs.svg";
import KubernetesIcon from "img/icons/interests/kubernetes.svg";

import topicNameFormatting from "lib/utils/topic-name-formatting";

Expand All @@ -35,6 +37,8 @@ interface LanguagePillProps {
| "java"
| "typescript"
| "golang"
| "vue"
| "Kubernetes"
| string;
classNames?: string;
onClick?: () => void;
Expand All @@ -55,7 +59,9 @@ const LanguagePill = ({ topic, classNames, onClick }: LanguagePillProps) => {
c: CIcon,
ruby: RubyIcon,
java: JavaIcon,
golang: GolangIcon
golang: GolangIcon,
vue: VueIcon,
kubernetes: KubernetesIcon
};

return iconMap[name] || "";
Expand Down
12 changes: 7 additions & 5 deletions components/atoms/TextInput/text-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,11 @@ const TextInput = ({
name={name}
id={id || name || ""}
placeholder={placeholder || ""}
className={`flex-1 focus:outline-none ${classNames} ${
disabled && "bg-light-slate-3 cursor-not-allowed text-light-slate-9"
}`}
className={clsx(
"flex-1 focus:outline-none",
disabled && "bg-light-slate-3 cursor-not-allowed text-light-slate-9",
classNames
)}
disabled={disabled}
value={value}
onChange={handleChangeState}
Expand All @@ -72,9 +74,9 @@ const TextInput = ({
{!disabled && (
<>
{state === "valid" ? (
<CheckCircleFillIcon className="text-light-orange-9" size={12} />
<CheckCircleFillIcon className="ml-1 text-light-orange-9" size={12} />
) : !!value ? (
<span title="Clear input" className="flex items-center" onClick={handleResetInput}>
<span title="Clear input" className="flex items-center ml-1" onClick={handleResetInput}>
<XCircleFillIcon
className={clsx(
state === "invalid" && errorMsg ? "text-light-red-11" : "text-light-slate-8",
Expand Down
79 changes: 79 additions & 0 deletions components/atoms/TopContributorCard/top-contributor-card.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
import React, { useEffect, useState } from "react";

import Link from "next/link";
import { useRouter } from "next/router";
import { getAvatarByUsername } from "lib/utils/github";
import useFollowUser from "lib/hooks/useFollowUser";
import useSupabaseAuth from "lib/hooks/useSupabaseAuth";

import Avatar from "../Avatar/avatar";
import Button from "../Button/button";

export interface TopContributorCardProps {
login: string;
}

const TopContributorCard = ({ login }: TopContributorCardProps) => {
const router = useRouter();
const currentPath = router.asPath;

const { isError: notFollowing, follow, unFollow } = useFollowUser(login);
const [host, setHost] = useState("");
const { sessionToken, signIn } = useSupabaseAuth();

const handleFollowContributor = async () => {
try {
if (notFollowing) {
await follow();
return;
}
await unFollow();
} catch (error) {
console.log(error);
}
};

useEffect(() => {
if (typeof window !== "undefined") {
setHost(window.location.origin as string);
}
}, []);

return (
<div className="flex items-center justify-between w-full gap-4 bg-light-slate-1">
<Link href={`/user/${login}`}>
<div className="flex items-center gap-2">
<Avatar isCircle size={35} avatarURL={getAvatarByUsername(login)} />
<p className="font-semibold text-light-slate-12">{login}</p>
</div>
</Link>
{sessionToken && !notFollowing ? (
<Button
onClick={() =>
sessionToken
? handleFollowContributor()
: signIn({ provider: "github", options: { redirectTo: `${host}/${currentPath}` } })
}
className="!px-2 !py-1"
variant="primary"
>
following
</Button>
) : (
<Button
onClick={() =>
sessionToken
? handleFollowContributor()
: signIn({ provider: "github", options: { redirectTo: `${host}/${currentPath}` } })
}
className="!px-2 !py-1 border-light-orange-7 text-light-orange-10"
variant="text"
>
follow
</Button>
)}
</div>
);
};

export default TopContributorCard;
36 changes: 0 additions & 36 deletions components/atoms/TopUserCard/top-user-card.tsx

This file was deleted.

Loading

0 comments on commit 325d69e

Please sign in to comment.