Skip to content

Commit

Permalink
Fixing bugs and adding back lost files
Browse files Browse the repository at this point in the history
  • Loading branch information
DhairyaMajmudar committed May 22, 2024
1 parent ee91a74 commit 69a1eae
Show file tree
Hide file tree
Showing 7 changed files with 97 additions and 62 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/greet_on_first_merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Greet on User First PR Merge

on:
pull_request:
types: [closed]

jobs:
greet:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const prNumber = context.payload.pull_request.number;
const authorLogin = context.payload.pull_request.user.login;
const firstPR = await github.issues.listForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
pull_requests: {
state: 'closed',
author: authorLogin,
},
});
console.log(firstPR.data.length);
if (firstPR.data.length === 1) {
const greetingMessage = ` Congratulations, @${authorLogin} for your first pull request merge in this repository! 🎉🎉. Thanks for your contribution to JSON Schema! `;
await github.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: prNumber,
body: greetingMessage
});
}
6 changes: 3 additions & 3 deletions components/Accordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const Accordion: React.FC<AccordionProps> = ({ items }) => {
activeIndex === index ? 'max-h-96' : 'max-h-20'
} ${index === items.length - 1 ? 'border-b-2' : ''}`}
>
<div className='flex justify-between items-center p-4 cursor-pointer'>
<div className='flex justify-between p-4 pl-2 cursor-pointer'>
<div className='text-[20px]'>
<a
href={`#${item.id}`}
Expand All @@ -69,7 +69,7 @@ const Accordion: React.FC<AccordionProps> = ({ items }) => {
</a>
</div>
<div
className={`transform transition-transform text-[20px] ${
className={`transform transition-transform duration-200 max-h-7 text-[20px] ${
activeIndex === index ? 'rotate-45' : ''
}`}
onClick={() => handleToggle(index)}
Expand All @@ -80,7 +80,7 @@ const Accordion: React.FC<AccordionProps> = ({ items }) => {
{activeIndex === index && (
<div
id={`${item.id}`}
className='p-2 text-gray-500 dark:text-slate-200'
className='p-2 text-gray-500 dark:text-slate-200 pb-4'
>
{item.answer}
</div>
Expand Down
10 changes: 5 additions & 5 deletions components/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,30 +31,30 @@ const CardBody = ({
large: 'text-[1.5rem]',
};
return (
<div className='group relative h-full w-full max-w-lg rounded-lg border border-gray-200 bg-white p-6 px-12 shadow-3xl transition-colors delay-[150ms] ease-in-out hover:bg-slate-100'>
<div className='group relative h-full w-full max-w-lg rounded-lg border border-gray-200 bg-white p-6 px-12 shadow-3xl dark:shadow-2xl dark:shadow-slate-900 transition-colors delay-[150ms] ease-in-out hover:bg-slate-100 dark:bg-slate-800 hover:dark:bg-slate-900/30'>
<div className='flex justify-center '>
{image && <img src={image} className='h-32 p-2' />}
</div>
<div className='flex flex-row items-start mb-6'>
{icon && (
<span className='mr-6 flex h-14 w-14 flex-shrink-0 items-center justify-center rounded-lg border bg-blue-200 px-3 text-gray-900'>
<span className='mr-6 flex h-14 w-14 flex-shrink-0 items-center justify-center rounded-lg border bg-blue-200 px-3 text-gray-900 dark:text-white'>
<img src={icon} alt={title} className='h-full w-full' />
</span>
)}
<p
className={`mb-1 mt-1 items-center font-bold text-gray-900 ${headerSizeClasses[headerSize || 'medium']}`}
className={`mb-1 mt-1 items-center font-bold text-gray-900 dark:text-white ${headerSizeClasses[headerSize || 'medium']}`}
>
{title}
</p>
</div>
<hr className='mb-4 mt-3.5 h-px border-0 bg-gray-400' />
<p
className={`mb-8 dark:text-black mt-5 ${bodyTextSizeClasses[bodyTextSize || 'medium']} `}
className={`mb-8 text-black mt-5 dark:text-white ${bodyTextSizeClasses[bodyTextSize || 'medium']} `}
>
<TextTruncate element='span' line={3} text={body} />
</p>
{link && (
<p className='absolute bottom-3 right-5 font-medium opacity-0 transition-opacity delay-150 ease-in-out group-hover:opacity-100 dark:text-black'>
<p className='absolute bottom-3 right-5 font-medium opacity-0 transition-opacity delay-150 ease-in-out group-hover:opacity-100 text-black dark:text-white '>
Read More
</p>
)}
Expand Down
2 changes: 1 addition & 1 deletion data/use-cases.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[
{
"title": "JSON Schema oihgfewrnrnvon ",
"title": "JSON Schema use cases",
"summary": "At GitHub's Docs Engineering team, while shipping releases to production 20 times per day."
},
{
Expand Down
47 changes: 47 additions & 0 deletions data/welcome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
[
{
"title": "Overview",
"summary": "Ut minim anim non deserunt veniam. Ex sit eu voluptate labore sunt aute ",
"logo": "/icons/eye.svg",
"links": {
"lang": "URL1",
"url": "/overview/what-is-jsonschema"
}
},
{
"title": "Getting Started",
"summary": "Sit anim eu sunt nisi. Tempor cupidatat voluptate nostrud voluptate deserunt cupidatat dolor magna irure deserunt.",
"logo": "/icons/compass.svg",
"links": {
"lang": "URL1",
"url": "/learn/getting-started-step-by-step"
}
},
{
"title": "Reference",
"summary": "Adipisicing minim ex amet occaecat dolore quis nisi voluptate sit.",
"logo": "/icons/book.svg",
"links": {
"lang": "URL1",
"url": "/learn/glossary"
}
},
{
"title": "Specification",
"summary": "Deserunt et fugiat do adipisicing enim in nostrud Lorem anim ut amet enim.",
"logo": "/icons/clipboard.svg",
"links": {
"lang": "URL1",
"url": "/specification"
}
},
{
"title": "Other Resources",
"summary": "Deserunt et fugiat do adipisicing enim in nostrud Lorem anim ut amet enim.",
"logo": "/icons/bookshelf.svg",
"links": {
"lang": "URL1",
"url": "/resources/books"
}
}
]
2 changes: 1 addition & 1 deletion pages/overview/case-studies/index.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default function ContentExample() {
<title>{newTitle}</title>
</Head>
<Headline1>{newTitle}</Headline1>
<p>
<p className='text-[18px]'>
Learn how organizations are adopting and benefiting from JSON Schema.
</p>
<div className='w-full lg:w-full grid grid-cols-1 md:grid-cols-2 gap-6 my-[10px] mx-auto mt-8'>
Expand Down
54 changes: 2 additions & 52 deletions pages/overview/welcome/index.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,61 +4,11 @@ import Head from 'next/head';
import { Headline1 } from '~/components/Headlines';
import { SectionContext } from '~/context';
import Card from '~/components/Card';
import data from '~/data/welcome.json';

export default function Welcome() {
const newTitle = 'Welcome';
const data = [
{
title: 'Overview',
summary:
'Ut minim anim non deserunt veniam. Ex sit eu voluptate labore sunt aute ',
logo: '/icons/eye.svg',
links: {
lang: 'URL1',
url: '/overview/what-is-jsonschema',
},
},
{
title: 'Getting Started',
summary:
'Sit anim eu sunt nisi. Tempor cupidatat voluptate nostrud voluptate deserunt cupidatat dolor magna irure deserunt.',
logo: '/icons/compass.svg',
links: {
lang: 'URL1',
url: '/learn/getting-started-step-by-step',
},
},
{
title: 'Reference',
summary:
'Adipisicing minim ex amet occaecat dolore quis nisi voluptate sit.',
logo: '/icons/book.svg',
links: {
lang: 'URL1',
url: '/learn/glossary',
},
},
{
title: 'Specification',
summary:
'Deserunt et fugiat do adipisicing enim in nostrud Lorem anim ut amet enim.',
logo: '/icons/clipboard.svg',
links: {
lang: 'URL1',
url: '/specification',
},
},
{
title: 'Other Resources',
summary:
'Deserunt et fugiat do adipisicing enim in nostrud Lorem anim ut amet enim.',
logo: '/icons/bookshelf.svg',
links: {
lang: 'URL1',
url: '/resources/books',
},
},
];

return (
<SectionContext.Provider value='docs'>
<Head>
Expand Down

0 comments on commit 69a1eae

Please sign in to comment.