Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Implement Course Cards #56

Closed
wants to merge 34 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
31fde51
Add DonationV2
aleksKudr Oct 24, 2022
9bc849d
Fix format
aleksKudr Oct 24, 2022
83b32c4
Fix comment from review, add community, speakers
aleksKudr Oct 26, 2022
0e6d490
Fix lint & prettier
aleksKudr Oct 26, 2022
393dd6c
Add alt
aleksKudr Oct 26, 2022
55f7c14
Fix build error
aleksKudr Oct 27, 2022
60e502b
Fix build error
aleksKudr Oct 27, 2022
e0434ed
Merge pull request #28 from rolling-scopes/feature/issue-11
aleksKudr Oct 27, 2022
2e2d490
feat: update to next.js 13
Nov 5, 2022
30c27f8
Merge pull request #37 from rolling-scopes/feature/issue-36-update-to…
oleksiisydorenko1 Nov 8, 2022
6c687e5
feat: update schema social-link
SyleimanovSergey Nov 9, 2022
a4e05d3
feat: update schema social-link
SyleimanovSergey Nov 9, 2022
e08c33a
feat: update social-networking components
SyleimanovSergey Nov 9, 2022
17da27a
feat: update open modal social-networking
SyleimanovSergey Nov 9, 2022
8fbcb47
feat: update social-networking styles
SyleimanovSergey Nov 10, 2022
8a09d53
feat: add parnters and general merch
aleksKudr Nov 13, 2022
f5dc9f1
feat: update next config
SyleimanovSergey Nov 15, 2022
946766d
fix styles
aleksKudr Nov 17, 2022
df50530
Merge pull request #38 from rolling-scopes/feature/issue-22-issue-13
aleksKudr Nov 17, 2022
b22261c
for merge
crzoukman Nov 19, 2022
da38fe3
for merge
crzoukman Nov 19, 2022
2cd948e
for merge
crzoukman Nov 19, 2022
2c42b3a
Merge branch 'develop' into feature/issue-41-integration-for-social-l…
SyleimanovSergey Nov 20, 2022
fe25ae7
feat: add integration sanity
SyleimanovSergey Nov 20, 2022
ef12ba1
feat: rename components
SyleimanovSergey Nov 20, 2022
a613b1f
feat: implement FAQ (#34)
crzoukman Nov 21, 2022
c50857e
Merge branch 'develop' into feature/issue-41-integration-for-social-l…
SyleimanovSergey Nov 21, 2022
fb76d73
feat: refactoring social-media & FAQ
SyleimanovSergey Nov 21, 2022
d918884
feat: add close modal outside window
SyleimanovSergey Nov 22, 2022
2b9531b
Merge branch 'develop' of https://github.com/rolling-scopes/rs-site i…
crzoukman Nov 26, 2022
bba8c37
Merge pull request #43 from rolling-scopes/feature/issue-41-integrati…
SyleimanovSergey Nov 27, 2022
f3e0eaf
feat: add github action - run unit tests in response a pull request i…
crzoukman Nov 28, 2022
1acfb3f
Merge branch 'develop' of https://github.com/rolling-scopes/rs-site i…
crzoukman Dec 9, 2022
f7acec0
again and again
crzoukman Feb 2, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"extends": ["next/core-web-vitals", "airbnb-base", "prettier"],
"extends": ["next", "next/core-web-vitals", "airbnb-base", "prettier"],
"rules": {
"import/extensions": ["error", "never"],
"no-underscore-dangle": ["error", { "allow": ["_ref", "_id"] }]
"import/extensions": "off",
"no-underscore-dangle": ["error", { "allow": ["_ref", "_id"] }],
"import/prefer-default-export": "off",
"import/no-unresolved": "off"
}
}
24 changes: 24 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Pull Request

on:
pull_request:
branches: [develop]

jobs:
tests:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.9.0]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: install deps
run: npm install
- name: run unit tests
run: npm run test -- --watchAll=false --passWithNoTests
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,5 @@ next-env.d.ts
studio/.env.development

.idea

.vscode
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ Then set these variables in `.env.local`:
- `NEXT_PUBLIC_SANITY_PROJECT_ID` should be the `projectId` value from [`sanity.json`].
- `NEXT_PUBLIC_SANITY_DATASET` should be the `dataset` value from [`sanity.json`].
- `SANITY_API_READ_TOKEN` create an API token with `read-only` permissions:
- Run this to open your project settings or go to https://manage.sanity.io/ and open your project:
```bash
(cd studio && npx @sanity/cli manage)
```
- Go to **API** and the **Tokens** section at the bottom, launch its **Add API token** button.
- Name it `SANITY_API_READ_TOKEN`, set **Permissions** to `Viewer`.
- Hit **Save** and you can copy/paste the token.
- Run this to open your project settings or go to https://manage.sanity.io/ and open your project:
```bash
(cd studio && npx @sanity/cli manage)
```
- Go to **API** and the **Tokens** section at the bottom, launch its **Add API token** button.
- Name it `SANITY_API_READ_TOKEN`, set **Permissions** to `Viewer`.
- Hit **Save** and you can copy/paste the token.

Your `.env.local` file should look like this:

Expand Down
4 changes: 4 additions & 0 deletions common/enums/paths/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export enum Paths {
MARKDOWNS_PATH = 'markdowns',
FAQ_PATH = 'FAQ'
}
23 changes: 23 additions & 0 deletions components/Accordion/accordion.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { FC } from 'react';
import type { AccordionItem as AccordionItemType } from 'types';
import styles from './styles.module.scss';
import { AccordionItem } from './ui/AccordionItem';

type Props = {
posts: AccordionItemType[];
limit?: number;
};

const Accordion: FC<Props> = ({ posts, limit }) => {
const slicedPosts = posts.slice(0, limit);

return (
<ul className={styles.accordion}>
{slicedPosts.map((post, idx) => (
<AccordionItem title={post.title} content={post.content} key={idx} />
))}
</ul>
);
};

export default Accordion;
1 change: 1 addition & 0 deletions components/Accordion/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as Accordion } from './accordion';
3 changes: 3 additions & 0 deletions components/Accordion/styles.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.accordion {
@apply max-w-[1062px];
}
45 changes: 45 additions & 0 deletions components/Accordion/ui/AccordionItem/accordion-item.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { FC, useState, useRef } from 'react';
import cn from 'classnames';
import { MDXRemote } from 'next-mdx-remote';
import type { AccordionItem as AccordionItemType } from 'types';
import styles from './styles.module.scss';
import { styledTags } from '../styled-tags';

const AccordionItem: FC<AccordionItemType> = ({ title, content }) => {
const [isOpen, setIsOpen] = useState(false);

const ref = useRef<HTMLDivElement>();

const itemStyles = cn(styles.accordionItem, {
[styles.withPadding]: isOpen
});
const titleIconStyles = cn(styles.plus, {
[styles.rotatePlus]: isOpen
});
const contentStyles = isOpen
? { height: ref.current.scrollHeight }
: { height: 0 };

function accordionItemHandler() {
setIsOpen(!isOpen);
}

return (
<li className={itemStyles}>
<div className={styles.accordionItemTitle} onClick={accordionItemHandler}>
{title && <MDXRemote {...title} components={styledTags} />}
<span className={titleIconStyles} />
</div>

<div
ref={ref}
style={contentStyles}
className={styles.accordionItemContent}
>
{content && <MDXRemote {...content} components={styledTags} />}
</div>
</li>
);
};

export default AccordionItem;
1 change: 1 addition & 0 deletions components/Accordion/ui/AccordionItem/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as AccordionItem } from './accordion-item';
36 changes: 36 additions & 0 deletions components/Accordion/ui/AccordionItem/styles.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
.accordionItem {
@apply transition-all flex flex-col gap-0 border-b-[1px] border-solid border-[#000000];
}

.withPadding {
@apply pb-[30px];
}

.accordionItemTitle {
@apply font-semibold text-[24px] leading-[30px] relative cursor-pointer py-[30px];
}

.accordionItemContent {
@apply text-[16px] font-normal leading-[24px] pr-[20px] overflow-y-hidden h-0;
}

.showContent {
@apply h-auto;
}

.plus {
--b: 5px;
background: conic-gradient(
from 90deg at var(--b) var(--b),
#fff 90deg,
#000 0
)
calc(100% + var(--b) / 2) calc(100% + var(--b) / 2) / calc(50% + var(--b))
calc(50% + var(--b));

@apply w-[20px] aspect-[1] inline-block border-none m-0 absolute right-0 top-[50%] translate-y-[-50%];
}

.rotatePlus {
@apply translate-y-[-50%] rotate-45;
}
1 change: 1 addition & 0 deletions components/Accordion/ui/styled-tags/StyledAnchor/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as StyledAnchor } from './styled-anchor';
10 changes: 10 additions & 0 deletions components/Accordion/ui/styled-tags/StyledAnchor/styled-anchor.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { AnchorHTMLAttributes, FC } from 'react';
import styles from './styles.module.scss';

type Props = AnchorHTMLAttributes<HTMLAnchorElement>;

const StyledAnchor: FC<Props> = props => (
<a className={styles.anchor} {...props} />
);

export default StyledAnchor;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.anchor {
text-decoration: underline;
}
1 change: 1 addition & 0 deletions components/Accordion/ui/styled-tags/StyledHeading/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as StyledHeading } from './styled-heading';
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { FC, HTMLAttributes } from 'react';
import styles from './styles.module.scss';

type Props = HTMLAttributes<HTMLHeadingElement>;

const StyledHeading: FC<Props> = props => (
<h2 className={styles.heading} {...props} />
);

export default StyledHeading;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.heading {
font-size: 24px;
}
12 changes: 12 additions & 0 deletions components/Accordion/ui/styled-tags/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { StyledAnchor } from './StyledAnchor';
import { StyledHeading } from './StyledHeading';

export const styledTags = {
a: StyledAnchor,
h1: StyledHeading,
h2: StyledHeading,
h3: StyledHeading,
h4: StyledHeading,
h5: StyledHeading,
h6: StyledHeading
};
34 changes: 34 additions & 0 deletions components/Community/community.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import Image from 'next/image';
import { urlForImage } from '@/lib/sanity';
import { CommunityT } from 'types';
import styles from './styles.module.scss';

type Props = {
community: CommunityT;
};

export default function Community({ community }: Props) {
const { picture, title, description } = community || {};
const imageUrl = picture?.asset?._ref
? urlForImage(picture).url()
: 'https://source.unsplash.com/630x441/';
return (
<section>
<div className={styles.block}>
<div className={styles.content}>
<div className={styles.image}>
<Image src={imageUrl} layout="fill" alt="community" />
</div>

<div className={styles.right}>
<h1 className={styles.title}>{title}</h1>
<p
dangerouslySetInnerHTML={{ __html: description }}
className={styles.description}
></p>
</div>
</div>
</div>
</section>
);
}
3 changes: 3 additions & 0 deletions components/Community/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import Community from './community';

export default Community;
35 changes: 35 additions & 0 deletions components/Community/styles.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
.block {
@apply container px-20 py-20 mx-auto;
}

.content {
@apply lg:-mx-6 lg:flex;
}

.right {
@apply lg:w-1/2;
}

.title {
@apply text-3xl font-bold;
color: #1a1a1a;
}

.description {
@apply mt-3 text-sm md:text-sm;
color: #1a1a1a;
}

.link {
@apply inline-flex justify-center text-sm font-semibold py-2.5 px-4 text-white mt-6;
background-color: #191b1d;
}

.image {
@apply w-full h-72 lg:h-80 lg:mr-32 lg:w-1/2;
position: relative;

& > span > img {
@apply object-cover;
}
}
22 changes: 22 additions & 0 deletions components/DonationV1/donation-v1.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import Link from 'next/link';
import { DonationV1T } from 'types';
import styles from './styles.module.scss';

type Props = {
donation: DonationV1T;
};

export default function DonationV1({ donation }: Props) {
const { title, description, link, titleLink } = donation || {};
return (
<section className={styles.block}>
<div className={styles.container}>
<h1 className={styles.title}>{title}</h1>
<span className={styles.description}>{description}</span>
<Link href={link ?? ''} className={styles.link}>
{titleLink}
</Link>
</div>
</section>
);
}
23 changes: 0 additions & 23 deletions components/DonationV1/donationV1.tsx

This file was deleted.

3 changes: 3 additions & 0 deletions components/DonationV1/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import DonationV1 from './donation-v1';

export default DonationV1;
21 changes: 21 additions & 0 deletions components/DonationV1/styles.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.block {
@apply flex flex-col justify-center h-80 text-center px-8 dark:text-white;
background-color: #191b1d;
}

.container {
@apply flex flex-col justify-center items-center mx-auto md:max-w-[50%];
}

.title {
@apply text-slate-900 text-4xl tracking-tight font-extrabold sm:text-5xl dark:text-white;
}

.description {
@apply mt-6 text-base;
}

.link {
@apply inline-flex justify-center text-sm font-semibold py-2.5 px-4 bg-white mt-6 ml-8;
color: #191b1d;
}
Loading