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

Explorer Pages: FIX - Sort button, api url + Add Icon #119

Merged
merged 1 commit into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions components/NodesData.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ const NodesData = () => {
const fetchNodesData = async () => {
try {
const response = await axios.get(
` ${EREBRUS_GATEWAY_URL}api/v1.0/nodes/all`,
`https://gateway.erebrus.io/api/v1.0/nodes/all`,
{
headers: {
Accept: "application/json, text/plain, /",
Expand Down Expand Up @@ -304,12 +304,12 @@ const NodesData = () => {



<div className="relative inline-block text-left w-[30vh]">
<div className="relative inline-block text-left min-w-[30vh] ">
<button
onClick={toggleDropdown}
className="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-12 rounded inline-flex items-center"
>
<SortAscendingOutlined /> {sortByDisplay || 'Sort'} <svg className={`-mr-1 ml-2 h-5 w-5 transform transition-transform ${ isOpen ? 'rotate-180' : 'rotate-0' }`} xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
<SortAscendingOutlined /> { sortByDisplay || ' Sort'} <svg className={`-mr-1 ml-2 h-5 w-5 transform transition-transform ${ isOpen ? 'rotate-180' : 'rotate-0' }`} xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
<path
fillRule="evenodd"
d="M5.23 7.21a.75.75 0 011.06.02L10 10.94l3.71-3.71a.75.75 0 111.06 1.06l-4.25 4.25a.75.75 0 01-1.06 0l-4.25-4.25a.75.75 0 01.02-1.06z"
Expand Down
4 changes: 2 additions & 2 deletions components/nodedataDwifi.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,12 @@ const NodeDwifiStream = () => {
</div>
)}
</div>
<div className="relative inline-block ml-4" ref={sortRef}>
<div className="relative inline-block ml-4 min-w-[30vh]" ref={sortRef}>
<button
onClick={() => setShowSortOptions(!showSortOptions)}
className="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-12 rounded"
>
<SortAscendingOutlined /> {sortByDisplay || 'Sort'}
<SortAscendingOutlined /> {sortByDisplay || ' Sort'}
</button>
{showSortOptions && (
<div className="absolute right-0 mt-2 w-48 bg-blue-500 rounded-md shadow-lg z-10">
Expand Down
4 changes: 3 additions & 1 deletion pages/dwifi.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import Link from "next/link";
import NodeDwifiStream from "../components/nodedataDwifi";
import { motion } from "framer-motion";
import dynamic from 'next/dynamic';
import { EnvironmentOutlined } from '@ant-design/icons';


const DwifiMap = dynamic(() => import('../components/DwifiMap'), { ssr: false });

Expand Down Expand Up @@ -54,7 +56,7 @@ const Dwifi = () => {
className="text-white font-bold py-3 px-10 rounded-full bg-[#5696FF] text-lg cursor-pointer"
onClick={scrollToMap}
>
Active Node Map
<EnvironmentOutlined className="inline-block mr-2 animate-bounce duration-700 ease-in-out" /> Active Node Map
</motion.div>
</div>
</div>
Expand Down
5 changes: 3 additions & 2 deletions pages/explorer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Link from "next/link";
import NodesData from "../components/NodesData";
import dynamic from 'next/dynamic';
import { motion } from "framer-motion";
import { EnvironmentOutlined } from '@ant-design/icons';

const DvpnMap = dynamic(() => import('../components/DvpnMap'), { ssr: false });
const EREBRUS_GATEWAY_URL = process.env.NEXT_PUBLIC_EREBRUS_BASE_URL;
Expand All @@ -15,7 +16,7 @@ const Explorer = () => {
useEffect(() => {
async function fetchNodes() {
try {
const response = await fetch(`$https://gateway.erebrus.io/api/v1.0/nodes/all`);
const response = await fetch(`https://gateway.erebrus.io/api/v1.0/nodes/all`);
const data = await response.json();
if (data && Array.isArray(data.payload)) {
setNodes(data.payload);
Expand Down Expand Up @@ -79,7 +80,7 @@ const Explorer = () => {
className="text-white font-bold py-3 px-10 rounded-full bg-[#5696FF] text-lg inline-block cursor-pointer"
onClick={scrollToMap}
>
Active Node Map
< EnvironmentOutlined className="inline-block mr-2 animate-bounce duration-1000 ease-in-out" /> Active Node Map
</motion.div>
</div>
</div>
Expand Down