Skip to content

Commit

Permalink
Merge branch 'master' into manavsidd/searchbar-visibility
Browse files Browse the repository at this point in the history
  • Loading branch information
akshatnema authored May 3, 2023
2 parents 1523e51 + 4e9fd70 commit 7996dc9
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 32 deletions.
38 changes: 32 additions & 6 deletions .github/workflows/lighthouse-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,43 @@ jobs:
lighthouse-ci:
name: Lighthouse CI
runs-on: ubuntu-latest
if: "github.repository == 'asyncapi/website' && github.event.pull_request.draft == false &&!((github.actor == 'asyncapi-bot' && startsWith(github.event.pull_request.title, 'ci: update global workflows')) || (github.actor == 'asyncapi-bot' && startsWith(github.event.pull_request.title, 'chore(release):')) || (github.actor == 'allcontributors' && startsWith(github.event.pull_request.title, 'docs: add')))"

steps:
- uses: actions/checkout@v3
- if: >
!github.event.pull_request.draft && !(
(github.actor == 'asyncapi-bot' && (
startsWith(github.event.pull_request.title, 'ci: update global workflows') ||
startsWith(github.event.pull_request.title, 'chore: update code of conduct') ||
startsWith(github.event.pull_request.title, 'ci: update global contribution guide') ||
startsWith(github.event.pull_request.title, 'ci: update workflows for go projects') ||
startsWith(github.event.pull_request.title, 'ci: update workflows for nodejs projects') ||
startsWith(github.event.pull_request.title, 'ci: update release-related workflows for nodejs projects') ||
startsWith(github.event.pull_request.title, 'ci: update semantic release config file') ||
startsWith(github.event.pull_request.title, 'ci: update generic workflows') ||
startsWith(github.event.pull_request.title, 'ci: update workflows for docker-based projects') ||
startsWith(github.event.pull_request.title, 'chore(release):')
)) ||
(github.actor == 'allcontributors[bot]' &&
startsWith(github.event.pull_request.title, 'docs: add')
)
)
id: should_run
name: Should Run
run: echo "::set-output name=shouldrun::true"
- if: steps.should_run.outputs.shouldrun == 'true'
uses: actions/checkout@v3

- name: Await Netlify Preview
- if: steps.should_run.outputs.shouldrun == 'true'
name: Await Netlify Preview
uses: jakepartusch/wait-for-netlify-action@v1
id: netlify
with:
site_name: asyncapi-website
max_timeout: 600

- name: Lighthouse Audit
- if: steps.should_run.outputs.shouldrun == 'true'
name: Lighthouse Audit
id: lighthouse_audit
uses: treosh/lighthouse-ci-action@9.3.0
with:
Expand All @@ -34,7 +58,8 @@ jobs:
env:
PR_NUMBER: ${{ github.event.pull_request.number}}

- name: Lighthouse Score Report
- if: steps.should_run.outputs.shouldrun == 'true'
name: Lighthouse Score Report
id: lighthouse_score_report
uses: actions/github-script@v6
with:
Expand All @@ -59,7 +84,8 @@ jobs:
].join('\n')
core.setOutput("comment", comment);
- name: LightHouse Statistic Comment
- if: steps.should_run.outputs.shouldrun == 'true'
name: LightHouse Statistic Comment
id: lighthouse_statistic_comment
uses: marocchino/sticky-pull-request-comment@v2.2.0
with:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/lighthouserc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
"ci": {
"assert": {
"assertions": {
"categories:accessibility": ["error", {"minScore": 0.70}]
"categories:accessibility": ["error", {"minScore": 0.98}],
"categories:best-practices": ["error", {"minScore": 1.00}],
"categories:seo": ["error", {"minScore": 1.00}]
}
},
"collect": {
Expand Down
17 changes: 17 additions & 0 deletions components/icons/NavItemDropdown.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const NavItemDropdown = () => (
<span className="inline-block">
<svg
className="text-gray-400 h-5 w-5 group-hover:text-gray-500 group-focus:text-gray-500 transition ease-in-out duration-150"
fill="currentColor"
viewBox="0 0 20 20"
>
<path
fillRule="evenodd"
d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"
clipRule="evenodd"
/>
</svg>
</span>
);

export default NavItemDropdown;
43 changes: 24 additions & 19 deletions components/navigation/NavItem.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import Link from 'next/link'
import { useRouter } from 'next/router';
import NavItemDropdown from './../icons/NavItemDropdown';

export default function NavItem ({
text,
href,
route='',
target = '_self',
onClick = () => {},
onMouseEnter = () => {},
Expand All @@ -21,24 +22,28 @@ export default function NavItem ({
)
}

// dom attributes common to both button and link
const attrs = {
onClick,
onMouseEnter,
className: `${className} group inline-flex items-center space-x-2 font-body text-base leading-6 font-semibold hover:text-gray-900 focus:outline-none focus:text-gray-900 tracking-heading transition ease-in-out duration-150`
}

if(href) {
return (
<Link href={href}>
<a {...attrs} className={`${attrs.className} ${router.pathname.startsWith(href) ? "text-black" :"text-gray-700"}`} target={target}>
<span>{text}</span>
{hasDropdown && <NavItemDropdown />}
</a>
</Link>
)
}

return (
<button type="button" onClick={href ? undefined : onClick} onMouseEnter={onMouseEnter} className={`${className} group text-gray-700 inline-flex items-center space-x-2 text-base leading-6 font-semibold hover:text-gray-900 focus:outline-none focus:text-gray-900 tracking-heading transition ease-in-out duration-150`}>
{href ? (
<Link href={href}>
<a target={target} rel="noopener noreferrer" className={`${className} font-body text-base leading-6 font-semibold text-gray-700 hover:text-gray-900 focus:outline-none focus:text-gray-900 transition ease-in-out duration-150 ${router.pathname.startsWith(href) ? "text-black" :"text-gray-700"}`}>
{text}
</a>
</Link>
) : (
<span className={`${router.pathname.startsWith(route) ? "text-black" :"text-gray-700"}`}>{text}</span>
)}
{hasDropdown && (
<div className='inline-block'>
<svg className="text-gray-400 h-5 w-5 group-hover:text-gray-500 group-focus:text-gray-500 transition ease-in-out duration-150" fill="currentColor" viewBox="0 0 20 20">
<path fillRule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clipRule="evenodd" />
</svg>
</div>
)}
<button type="button" {...attrs} className={`${attrs.className} text-gray-700`}>
<span>{text}</span>
{hasDropdown && <NavItemDropdown />}
</button>
)
}
}
12 changes: 6 additions & 6 deletions config/newsroom_videos.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
[
{
"image_url": "https://i.ytimg.com/vi/Z8lnRHL-lCM/hqdefault.jpg",
"title": "Community meeting (May 2nd 2023)",
"description": "https://github.com/asyncapi/community/issues/688.",
"videoId": "Z8lnRHL-lCM"
},
{
"image_url": "https://i.ytimg.com/vi/WcmH9ySIX9o/hqdefault.jpg",
"title": "Tackling Interoperability Challenges In Open-Source",
Expand All @@ -22,11 +28,5 @@
"title": "Adding support for non-JSON schemas (April 18th 2023)",
"description": "https://github.com/asyncapi/community/issues/668.",
"videoId": "JFPERXh2ZUY"
},
{
"image_url": "https://i.ytimg.com/vi/hN6aE3Ebn08/hqdefault.jpg",
"title": "Spec 3.0 meeting (April 13th 2023)",
"description": "https://github.com/asyncapi/community/issues/649.",
"videoId": "hN6aE3Ebn08"
}
]

0 comments on commit 7996dc9

Please sign in to comment.