Skip to content

Commit

Permalink
Merge branch 'master' into fix/automated-list-meeting-and-others
Browse files Browse the repository at this point in the history
  • Loading branch information
jerensl authored Jul 15, 2024
2 parents 17523a0 + 81e1f7e commit d1aba21
Show file tree
Hide file tree
Showing 80 changed files with 37,045 additions and 11,925 deletions.
27 changes: 20 additions & 7 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"airbnb-base",
"next/core-web-vitals",
"eslint:recommended",
"plugin:prettier/recommended"
"plugin:prettier/recommended",
"plugin:storybook/recommended"
],
"env": {
"browser": true,
Expand Down Expand Up @@ -52,7 +53,11 @@
"overrides": [
// Configuration for TypeScript files
{
"files": ["**/*.ts", "**/*.tsx", "netlify/*.ts"],
"files": [
"**/*.ts",
"**/*.tsx",
"netlify/*.ts"
],
"plugins": [
"@typescript-eslint",
"tailwindcss",
Expand All @@ -63,7 +68,8 @@
"plugin:tailwindcss/recommended",
"airbnb-typescript",
"next/core-web-vitals",
"plugin:prettier/recommended"
"plugin:prettier/recommended",
"plugin:storybook/recommended"
],
"parserOptions": {
"project": "./tsconfig.json"
Expand Down Expand Up @@ -93,7 +99,9 @@
"unused-imports/no-unused-imports": "error",
"unused-imports/no-unused-vars": [
"error",
{ "argsIgnorePattern": "^_" }
{
"argsIgnorePattern": "^_"
}
],
// Variables
"init-declarations": "off",
Expand Down Expand Up @@ -192,7 +200,10 @@
"ignoreChainWithDepth": 4
}
],
"newline-after-var": ["error", "always"],
"newline-after-var": [
"error",
"always"
],
"no-array-constructor": "error",
"no-lonely-if": "error",
"no-mixed-operators": "off",
Expand Down Expand Up @@ -294,10 +305,12 @@
}
},
{
"files": ["components/logos/*"],
"files": [
"components/logos/*"
],
"rules": {
"max-len": "off"
}
}
]
}
}
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,7 @@ meetings.json
cypress/screenshots
cypress/videos
/config/finance/json-data/*
*.mdx
/pages/**/*.mdx
*storybook.log
/storybook-static/
coverage
23 changes: 23 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import type { StorybookConfig } from "@storybook/nextjs";

const config: StorybookConfig = {
stories: [
"../components/**/*.mdx",
"../components/**/*.stories.@(js|jsx|mjs|ts|tsx)",
],
addons: [
"@storybook/addon-onboarding",
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-interactions",
],
docs: {
defaultName: 'Documentation',
},
framework: {
name: "@storybook/nextjs",
options: {},
},
staticDirs: ["../public"],
};
export default config;
40 changes: 40 additions & 0 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import React from "react";
import "../styles/globals.css";
import type { Preview } from "@storybook/react";
import {
Title,
Subtitle,
Description,
Primary,
Controls,
Stories,
} from '@storybook/blocks';

const preview: Preview = {
tags: ['autodocs'],
parameters: {
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/i,
},
},
docs: {
toc: {
title: 'Table of contents',
},
page: () => (
<>
<Title />
<Subtitle />
<Description />
<Primary />
<Controls />
<Stories />
</>
)
}
}
};

export default preview;
8 changes: 4 additions & 4 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
* @derberg @akshatnema @magicmatatjahu @anshgoyalevil @mayaleeeee @asyncapi-bot-eve

# All .md files
*.md @alequetzalli @asyncapi-bot-eve
*.md @quetzalliwrites @asyncapi-bot-eve

markdown/blog/*.md @thulieblack @alequetzalli
markdown/community/*.md @thulieblack @alequetzalli
markdown/blog/*.md @thulieblack @quetzalliwrites
markdown/community/*.md @thulieblack @quetzalliwrites

README.md @alequetzalli @derberg @akshatnema @magicmatatjahu @mayaleeeee @asyncapi-bot-eve
README.md @quetzalliwrites @derberg @akshatnema @magicmatatjahu @mayaleeeee @asyncapi-bot-eve
#docTriagers: TRohit20 BhaswatiRoy VaishnaviNandakumar J0SAL
#codeTriagers: sambhavgupta0705
21 changes: 19 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ This repository contains the sources of AsyncAPI website:

- It's powered by [Next.js](https://nextjs.org/),
- It uses [Tailwind](https://tailwindcss.com/) CSS framework,
- It's build and deployed with [Netlify](https://www.netlify.com/).
- It's build and deployed with [Netlify](https://www.netlify.com/),
- It uses [Storybook](https://storybook.js.org/) as a frontend workshop and for dociuenting UI components.

## Requirements

Expand Down Expand Up @@ -69,6 +70,14 @@ Use the following tools to set up the project:

7. Access the live development server at [localhost:3000](http://localhost:3000).

8. To run the storybook locally:

```bash
npm run dev:storybook
```

9. Access the live storybook development server at [localhost:6006](http://localhost:6006).


## Compose new blog post

Expand All @@ -88,14 +97,22 @@ To spin up a Gitpod codespace, go to http://gitpod.io/#https://github.com/asynca

### Build

To build a production-ready website, run the following command:
1. To build a production-ready website, run the following command:

```bash
npm run build
```

Generated files of the website go to the `.next` folder.

2. To build the production-ready storybook, run the following command:

```bash
npm run build:storybook
```

Generated files of the storybook go to the `storybook-static` folder.

### Run locally using Docker

#### Prerequisites:
Expand Down
33 changes: 10 additions & 23 deletions components/AuthorAvatars.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import React from 'react';

import Avatar from './Avatar';

interface Author {
name: string;
photo: string;
Expand All @@ -18,29 +20,14 @@ interface AuthorAvatarsProps {
export default function AuthorAvatars({ authors = [] }: AuthorAvatarsProps) {
return (
<>
{authors.map((author, index) => {
const avatar = (
<img
key={index}
title={author.name}
className={`${index > 0 ? `left- absolute${index * 7} top-0` : `mr- relative${(authors.length - 1) * 7}`}
z-${(authors.length - 1 - index) * 10} size-10 rounded-full border-2
border-white object-cover hover:z-50`}
src={author.photo}
loading='lazy'
data-testid='AuthorAvatars-img'
alt={author.name} // Added alt attribute here
/>
);

return author.link ? (
<a href={author.link} key={index} data-testid='AuthorAvatars-link'>
{avatar}
</a>
) : (
<React.Fragment key={index}>{avatar}</React.Fragment>
);
})}
{authors.map((author, index) => (
<Avatar
key={index}
{...author}
className={`${index > 0 ? `left- absolute${index * 7} top-0` : `mr- relative${(authors.length - 1) * 7}`}
z-${(authors.length - 1 - index) * 10}`}
/>
))}
</>
);
}
20 changes: 20 additions & 0 deletions components/Avatar.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import type { Meta, StoryObj } from '@storybook/react';

import Avatar from './Avatar';

const meta: Meta<typeof Avatar> = {
title: 'Components/Avatar',
component: Avatar
};

export default meta;

type Story = StoryObj<typeof Avatar>;

export const DefaultAvatar: Story = {
args: {
name: 'Avatar',
link: 'https://www.asyncapi.com/',
photo: '/favicon-32x32.png'
}
};
41 changes: 41 additions & 0 deletions components/Avatar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import React from 'react';

interface AvatarProps {
// eslint-disable-next-line prettier/prettier

/** The name of the avatar. */
name: string;

/** The photo of the avatar. */
photo: string;

/** The link of the avatar. */
link?: string;

/** The class name to be applied to the avatar. */
className: string;
}

/**
* This component renders avatar.
*/
export default function Avatar({ name, photo, link, className }: AvatarProps) {
const avatar = (
<img
title={name}
className={`size-10 rounded-full border-2 border-white object-cover hover:z-50 ${className}`}
src={photo}
loading='lazy'
data-testid='Avatars-img'
alt={name}
/>
);

return link ? (
<a href={link} data-testid='Avatars-link'>
{avatar}
</a>
) : (
<React.Fragment>{avatar}</React.Fragment>
);
}
Loading

0 comments on commit d1aba21

Please sign in to comment.