- {resources.map(({ name, icon }) =>
+ {[{ name: "All", icon: faGlobeAsia }, ...resources].map(({ name, icon }) =>
handleTabChange(name)}
className={"cursor-pointer dark:text-gray-500 px-2 pt-1 border-primary-600 pb-1 text-center" + (name === resource ? " border-b-2 dark:text-primary-500 text-indigo-800" : "")}
@@ -91,7 +91,7 @@ const SearchField = ({ isFocus, onFocus, resource, setResource }) => {
value={searchText}
type="text"
className="p-4 pl-6 text-base md:text-xl transition-shadow duration-300 ease-in-out shadow-md hover:shadow-lg focus:shadow-xl placeholder-gray-600 dark:text-white rounded-xl z-10 outline-none w-full absolute top-0 left-0 bg-transparent"
- placeholder={`Search for ${resource} in States or Districts`}
+ placeholder={`Search for ${resource} resources in States or Districts`}
/>
{
!searchText &&
diff --git a/pages/index.jsx b/pages/index.jsx
index 26cdc0b8c..20713d168 100644
--- a/pages/index.jsx
+++ b/pages/index.jsx
@@ -15,7 +15,7 @@ export default function Home() {
const { locale } = useLocaleContext();
const t = useLocale(locale, 'home');
- const [resource, setResource] = useState("Oxygen");
+ const [resource, setResource] = useState("All");
const [isToShowSuggestion, setIsToShowSuggestion] = useState(false);
return (
From d0ba2ba53d9a648108cc4fd1bb68132929d08eb2 Mon Sep 17 00:00:00 2001
From: Shri Hari L <57325503+shrihari689@users.noreply.github.com>
Date: Thu, 13 May 2021 20:59:14 +0530
Subject: [PATCH 6/6] =?UTF-8?q?=F0=9F=92=B3=20Add=20Source=20Name=20to=20R?=
=?UTF-8?q?esource=20Card?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
components/ResourceCard.jsx | 38 +++++++++++++++++++------------------
1 file changed, 20 insertions(+), 18 deletions(-)
diff --git a/components/ResourceCard.jsx b/components/ResourceCard.jsx
index d341120b5..ab650691f 100644
--- a/components/ResourceCard.jsx
+++ b/components/ResourceCard.jsx
@@ -8,7 +8,6 @@ import { useRouter } from 'next/router';
import { getHaversineDistance } from '@lib/utils';
import Badge from './Badge';
import Description from './Description';
-
import FeedbackCounter from './FeedbackCounter';
const ResourceCard = ({ data, type: filterType, currentLocation }) => {
@@ -21,7 +20,7 @@ const ResourceCard = ({ data, type: filterType, currentLocation }) => {
// Metadata
const { external_id: id, last_verified_on, verification_status } = data;
- const { upvotes, downvotes } = data;
+ const { upvotes, downvotes, data_name } = data;
// Oxygen Related Data
const { quantity_available, price } = data;
@@ -43,7 +42,7 @@ const ResourceCard = ({ data, type: filterType, currentLocation }) => {
const category = `${type}` + (resource_type ? ` - ${resource_type}` : '')
- const directions = getGoogleMapsDirectionLink(latitude,longitude);
+ const directions = getGoogleMapsDirectionLink(latitude, longitude);
return (
@@ -64,7 +63,7 @@ const ResourceCard = ({ data, type: filterType, currentLocation }) => {
{district}
- { directions.length > 0 &&
+ {directions.length > 0 &&
}
{
- source_link &&
-
@@ -191,18 +193,18 @@ const ResourceCard = ({ data, type: filterType, currentLocation }) => {
{/*
*/}
- { currentLocation && latitude && longitude && (
-
- Approximately
-
- {getHaversineDistance(currentLocation, {
- lat: latitude,
- lng: longitude
- })} Kms
+ {currentLocation && latitude && longitude && (
+
+ Approximately
+
+ {getHaversineDistance(currentLocation, {
+ lat: latitude,
+ lng: longitude
+ })} Kms
+
+ from your location
- from your location
-
- )}
+ )}