From 4d15989b2832c3514fca18f3178a967c1fc9ad18 Mon Sep 17 00:00:00 2001 From: towfiqi Date: Thu, 29 Feb 2024 11:37:45 +0600 Subject: [PATCH] feat: Adds a Keyword Research Section. - Adds a /research page to the app that lets users generate keyword ideas based on given keywords. - Allows the ability to export keywords. --- components/common/Icon.tsx | 14 +++ components/common/SelectField.tsx | 6 +- components/common/TopBar.tsx | 24 +++- components/ideas/KeywordIdeasTable.tsx | 33 +++++- pages/api/ideas.ts | 7 +- pages/research/index.tsx | 148 +++++++++++++++++++++++++ services/adwords.tsx | 19 ++-- utils/adwords.ts | 33 +++--- utils/client/exportcsv.ts | 14 +++ 9 files changed, 260 insertions(+), 38 deletions(-) create mode 100644 pages/research/index.tsx diff --git a/components/common/Icon.tsx b/components/common/Icon.tsx index 068bec9..3f8d35d 100644 --- a/components/common/Icon.tsx +++ b/components/common/Icon.tsx @@ -294,6 +294,20 @@ const Icon = ({ type, color = 'currentColor', size = 16, title = '', classes = ' } + {type === 'research' + && + + + + + + + } + {type === 'domains' + && + + + } ); }; diff --git a/components/common/SelectField.tsx b/components/common/SelectField.tsx index e631f10..3056a46 100644 --- a/components/common/SelectField.tsx +++ b/components/common/SelectField.tsx @@ -17,6 +17,7 @@ type SelectFieldProps = { maxHeight?: number|string, rounded?: string, flags?: boolean, + inline?: boolean, emptyMsg?: string } const SelectField = (props: SelectFieldProps) => { @@ -30,6 +31,7 @@ const SelectField = (props: SelectFieldProps) => { maxHeight = 96, fullWidth = false, rounded = 'rounded-3xl', + inline = false, flags = false, label = '', emptyMsg = '' } = props; @@ -70,7 +72,7 @@ const SelectField = (props: SelectFieldProps) => { }; return ( -
+
{label && }
{ return (
  • selectItem(opt)} > diff --git a/components/common/TopBar.tsx b/components/common/TopBar.tsx index e0c2ac0..3a3dd8e 100644 --- a/components/common/TopBar.tsx +++ b/components/common/TopBar.tsx @@ -37,7 +37,7 @@ const TopBar = ({ showSettings, showAddModal }:TopbarProps) => { SerpBear - {!isDomainsPage && ( + {!isDomainsPage && router.asPath !== '/research' && ( @@ -52,16 +52,30 @@ const TopBar = ({ showSettings, showAddModal }:TopbarProps) => {