Skip to content

Commit

Permalink
Embed versions
Browse files Browse the repository at this point in the history
  • Loading branch information
cagataycivici committed Jan 26, 2023
1 parent 2805a2d commit a550b56
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 37 deletions.
32 changes: 26 additions & 6 deletions components/layout/topbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,36 @@ import getConfig from 'next/config';
import Link from 'next/link';
import { useEffect, useRef, useState } from 'react';
import { CSSTransition } from 'react-transition-group';
import { VersionService } from '../../service/VersionService';
import { Badge } from '../lib/badge/Badge';

export default function Topbar(props) {
const [activeMenuIndex, setActiveMenuIndex] = useState(null);
const [versions, setVersions] = useState([]);
const versions = [
{
"version": "v9",
"url": "https://www.primereact.org"
},
{
"version": "v8",
"url": "https://www.primefaces.org/primereact"
},
{
"version": "v7",
"url": "https://www.primefaces.org/primereact-v7"
},
{
"version": "v6",
"url": "https://www.primefaces.org/primereact-v6"
},
{
"version": "v5",
"url": "https://www.primefaces.org/primereact-v5"
},
{
"version": "v4",
"url": "https://www.primefaces.org/primereact-v4"
}
];

const onMenuButtonClick = () => {
props.onMenuButtonClick();
Expand Down Expand Up @@ -58,10 +82,6 @@ export default function Topbar(props) {
};
}, [activeMenuIndex]); // eslint-disable-line react-hooks/exhaustive-deps

useEffect(() => {
VersionService.getVersions().then((data) => setVersions(data));
}, []); // eslint-disable-line react-hooks/exhaustive-deps

const containerElement = useRef(null);
const scrollListener = useRef();

Expand Down
24 changes: 0 additions & 24 deletions public/versions.json

This file was deleted.

7 changes: 0 additions & 7 deletions service/VersionService.js

This file was deleted.

0 comments on commit a550b56

Please sign in to comment.