diff --git a/locales/en/common.json b/locales/en/common.json
index c4a8d56e5b..4c9ef4487f 100644
--- a/locales/en/common.json
+++ b/locales/en/common.json
@@ -253,6 +253,7 @@
"pagination-summary": "{{currentResultNumber}}-{{endOfResultNumber}} of {{totalNumberOfResults}} search results",
"pbuh": "Blessings of Allah be upon him",
"popular-links": "Popular Links",
+ "search-results-no-count": "Search Results",
"popup": {
"footnote": "Monthly donations allow us to focus less on fundraising",
"text-1": "We are committed to serving the world Quranic knowledge and technology, always for free.",
@@ -303,7 +304,8 @@
"results": "results",
"show-all": "Show all results",
"switch-mode": "Switch to Advanced Search",
- "title": "Search"
+ "title": "Search",
+ "more-results": "More results"
},
"seconds": "Seconds",
"see-new": "See What's New",
diff --git a/public/icons/search/arabic.svg b/public/icons/search/arabic.svg
new file mode 100644
index 0000000000..ecdc4e375f
--- /dev/null
+++ b/public/icons/search/arabic.svg
@@ -0,0 +1,5 @@
+
diff --git a/public/icons/search/ayah-range.svg b/public/icons/search/ayah-range.svg
new file mode 100644
index 0000000000..18e4ccaf4d
--- /dev/null
+++ b/public/icons/search/ayah-range.svg
@@ -0,0 +1,12 @@
+
diff --git a/public/icons/search/juz.svg b/public/icons/search/juz.svg
new file mode 100644
index 0000000000..706b46de0f
--- /dev/null
+++ b/public/icons/search/juz.svg
@@ -0,0 +1,5 @@
+
diff --git a/public/icons/search/page.svg b/public/icons/search/page.svg
new file mode 100644
index 0000000000..9d78539173
--- /dev/null
+++ b/public/icons/search/page.svg
@@ -0,0 +1,5 @@
+
diff --git a/public/icons/search/surah.svg b/public/icons/search/surah.svg
new file mode 100644
index 0000000000..1be7fb12d1
--- /dev/null
+++ b/public/icons/search/surah.svg
@@ -0,0 +1,9 @@
+
diff --git a/public/icons/search/translation.svg b/public/icons/search/translation.svg
new file mode 100644
index 0000000000..37ed847dbe
--- /dev/null
+++ b/public/icons/search/translation.svg
@@ -0,0 +1,8 @@
+
diff --git a/public/icons/search/transliteration.svg b/public/icons/search/transliteration.svg
new file mode 100644
index 0000000000..b1c37fec4e
--- /dev/null
+++ b/public/icons/search/transliteration.svg
@@ -0,0 +1,5 @@
+
diff --git a/src/components/CommandBar/CommandBar.module.scss b/src/components/CommandBar/CommandBar.module.scss
deleted file mode 100644
index 2b737bcfdd..0000000000
--- a/src/components/CommandBar/CommandBar.module.scss
+++ /dev/null
@@ -1,8 +0,0 @@
-@use "src/styles/breakpoints";
-
-.loadingContainer {
- flex: 1;
- display: flex;
- justify-content: center;
- align-items: center;
-}
diff --git a/src/components/CommandBar/CommandBarBase/CommandBarBase.module.scss b/src/components/CommandBar/CommandBarBase/CommandBarBase.module.scss
deleted file mode 100644
index d56db90499..0000000000
--- a/src/components/CommandBar/CommandBarBase/CommandBarBase.module.scss
+++ /dev/null
@@ -1,109 +0,0 @@
-@use "src/styles/theme";
-
-$content-animation-easing: cubic-bezier(0.16, 1, 0.3, 1);
-$overlay-background-light: hsla(0, 0%, 100%, 0.8);
-$overlay-background-dark: rgba(0, 0, 0, 0.8);
-$overlay-background-sepia: rgba(239, 226, 205, 0.7);
-$shadow: 0 16px 70px rgb(0 0 0 / 20%); // using custom shadow for now until we fix our token and design in dark theme;
-$width: 95vw;
-$max-width: calc(20 * var(--spacing-mega));
-$max-height: 85vh;
-$min-height: calc(9 * var(--spacing-mega));
-
-@keyframes contentShow {
- 0% {
- opacity: 0;
- transform: var(--content-translate-position) scale(0.96);
- }
- 100% {
- opacity: 1;
- transform: var(--content-translate-position) scale(1);
- }
-}
-
-@keyframes contentHide {
- 0% {
- opacity: 1;
- transform: var(--content-translate-position) scale(1);
- }
- 100% {
- opacity: 0;
- transform: var(--content-translate-position) scale(0.96);
- }
-}
-
-.content {
- --content-translate-position: translate(-50%, -50%);
- [dir="rtl"] & {
- --content-translate-position: translate(50%, -50%);
- }
-
- background-color: var(--color-background-default);
- border-radius: var(--border-radius-rounded);
- box-shadow: $shadow;
- position: fixed;
- inset-block-start: 50%;
- inset-inline-start: 50%;
- transform: var(--content-translate-position);
- width: $width;
- max-width: $max-width;
- max-height: $max-height;
- min-height: $min-height;
- display: flex;
- flex-direction: column;
- @media (prefers-reduced-motion: no-preference) {
- &[data-state="open"] {
- animation: contentShow var(--transition-fast) $content-animation-easing;
- }
- &[data-state="closed"] {
- animation: contentHide var(--transition-fast) $content-animation-easing;
- }
- }
- &:focus {
- outline: none;
- }
- z-index: var(--z-index-modal);
-}
-
-@keyframes overlayShow {
- from {
- opacity: 0;
- }
- to {
- opacity: 1;
- }
-}
-
-@keyframes overlayHide {
- from {
- opacity: 1;
- }
- to {
- opacity: 0;
- }
-}
-
-.overlay {
- @include theme.light {
- background-color: $overlay-background-light;
- }
- @include theme.dark {
- background-color: $overlay-background-dark;
- }
- @include theme.sepia {
- background-color: $overlay-background-sepia;
- }
- backdrop-filter: blur(6px);
- position: fixed;
- inset: 0;
-
- @media (prefers-reduced-motion: no-preference) {
- &[data-state="open"] {
- animation: overlayShow var(--transition-fast) ease;
- }
- &[data-state="closed"] {
- animation: overlayHide var(--transition-fast) ease;
- }
- }
- z-index: var(--z-index-overlay);
-}
diff --git a/src/components/CommandBar/CommandBarBase/CommandBarBase.tsx b/src/components/CommandBar/CommandBarBase/CommandBarBase.tsx
deleted file mode 100644
index b4a7f720e4..0000000000
--- a/src/components/CommandBar/CommandBarBase/CommandBarBase.tsx
+++ /dev/null
@@ -1,24 +0,0 @@
-import * as Dialog from '@radix-ui/react-dialog';
-
-import styles from './CommandBarBase.module.scss';
-
-type CommandBarBaseProps = {
- onClickOutside: () => void;
- children: React.ReactNode;
- isOpen: boolean;
-};
-
-const CommandBarBase = ({ onClickOutside, children, isOpen }: CommandBarBaseProps) => {
- return (
-
-
-
-
- {children}
-
-
-
- );
-};
-
-export default CommandBarBase;
diff --git a/src/components/CommandBar/CommandBarTrigger/CommandBarTrigger.module.scss b/src/components/CommandBar/CommandBarTrigger/CommandBarTrigger.module.scss
deleted file mode 100644
index 6200496df3..0000000000
--- a/src/components/CommandBar/CommandBarTrigger/CommandBarTrigger.module.scss
+++ /dev/null
@@ -1,60 +0,0 @@
-@use "src/styles/breakpoints";
-@use "src/styles/theme";
-
-$width: calc(11 * var(--spacing-mega));
-
-.leftSection {
- display: flex;
- align-items: center;
-
- > svg {
- fill: var(--color-text-faded);
- opacity: var(--opacity-50);
- width: calc(1.4 * var(--spacing-medium));
- }
-
- .placeholder {
- margin-inline-start: var(--spacing-small);
- }
-}
-
-.container {
- position: relative;
- transition:
- box-shadow var(--transition-fast) ease,
- top var(--transition-fast) ease;
- box-sizing: border-box;
-
- background: var(--color-background-elevated);
-
- width: 100%;
- display: flex;
- align-items: center;
- padding: 0 calc(1.5 * var(--spacing-medium));
- color: var(--color-text-faded);
- min-height: calc(3 * var(--spacing-large));
- border-radius: var(--border-radius-pill);
- cursor: pointer;
- outline: inherit;
- font-size: var(--font-size-large);
- inset-block-start: 0;
- @include theme.light {
- box-shadow: var(--shadow-small);
- &:hover {
- color: var(--color-text-default);
- box-shadow: var(--shadow-large);
- }
- }
- justify-content: space-between;
-}
-
-.actionsContainer {
- display: flex;
- justify-content: center;
- align-items: center;
-}
-
-.searchButtonWrapper {
- margin-inline-end: calc(-1 * var(--spacing-xsmall));
- margin-inline-start: calc(var(--spacing-xsmall));
-}
diff --git a/src/components/CommandBar/CommandBarTrigger/index.tsx b/src/components/CommandBar/CommandBarTrigger/index.tsx
deleted file mode 100644
index 39c405007a..0000000000
--- a/src/components/CommandBar/CommandBarTrigger/index.tsx
+++ /dev/null
@@ -1,51 +0,0 @@
-import React, { useCallback } from 'react';
-
-import useTranslation from 'next-translate/useTranslation';
-import { useDispatch } from 'react-redux';
-
-import styles from './CommandBarTrigger.module.scss';
-
-import TarteelVoiceSearchTrigger from '@/components/TarteelVoiceSearch/Trigger';
-import KeyboardInput from '@/dls/KeyboardInput';
-import IconSearch from '@/icons/search.svg';
-import { toggleIsOpen } from '@/redux/slices/CommandBar/state';
-import { logButtonClick } from '@/utils/eventLogger';
-
-const CommandBarTrigger: React.FC = () => {
- const { t } = useTranslation('common');
- const dispatch = useDispatch();
- const onClick = useCallback(() => {
- logButtonClick('command_bar_homepage_trigger');
- dispatch({ type: toggleIsOpen.type });
- }, [dispatch]);
-
- return (
-
-
-
- {t('command-bar.placeholder')}
-
-
-
-
- {
- logButtonClick('command_bar_homepage_voice_search_trigger');
- }}
- />
-
-
-
- );
-};
-
-export default CommandBarTrigger;
diff --git a/src/components/CommandBar/index.tsx b/src/components/CommandBar/index.tsx
deleted file mode 100644
index 83354c9f3e..0000000000
--- a/src/components/CommandBar/index.tsx
+++ /dev/null
@@ -1,77 +0,0 @@
-/* eslint-disable react/no-multi-comp */
-import React, { useCallback } from 'react';
-
-import dynamic from 'next/dynamic';
-import { useHotkeys } from 'react-hotkeys-hook';
-import { shallowEqual, useDispatch, useSelector } from 'react-redux';
-
-import styles from './CommandBar.module.scss';
-import CommandBarBase from './CommandBarBase/CommandBarBase';
-
-import Spinner from '@/dls/Spinner/Spinner';
-import { selectCommandBarIsOpen, setIsOpen, toggleIsOpen } from '@/redux/slices/CommandBar/state';
-import { stopCommandBarVoiceFlow } from '@/redux/slices/voiceSearch';
-import { logEvent } from '@/utils/eventLogger';
-
-const CommandBarBody = dynamic(() => import('./CommandBarBody'), {
- ssr: false,
- loading: () => (
-
-
-
- ),
-});
-
-const getPressedShortcut = (event: KeyboardEvent): string => {
- let shortcut = '';
- if (event.metaKey) {
- shortcut = 'cmd';
- } else if (event.ctrlKey) {
- shortcut = 'ctrl';
- }
- return `${shortcut}_${event.key}`;
-};
-
-const CommandBar: React.FC = () => {
- const dispatch = useDispatch();
- const isOpen = useSelector(selectCommandBarIsOpen, shallowEqual);
- const toggleShowCommandBar = useCallback(
- (event: KeyboardEvent) => {
- // eslint-disable-next-line i18next/no-literal-string
- logEvent(`command_bar_${isOpen ? 'close' : 'open'}`, {
- // eslint-disable-next-line @typescript-eslint/naming-convention
- keyboard_shortcut: getPressedShortcut(event),
- });
- event.preventDefault();
- dispatch({ type: toggleIsOpen.type });
- },
- [dispatch, isOpen],
- );
- const closeCommandBar = useCallback(
- (event?: KeyboardEvent) => {
- const isClickedOutside = !event;
- // eslint-disable-next-line i18next/no-literal-string
- logEvent(`command_bar_close_${isClickedOutside ? 'outside_click' : 'esc_key'}`);
- dispatch({ type: setIsOpen.type, payload: false });
- dispatch({ type: stopCommandBarVoiceFlow.type });
- },
- [dispatch],
- );
- useHotkeys(
- 'meta+k, ctrl+k, meta+p, ctrl+p',
- toggleShowCommandBar,
- { enableOnFormTags: ['INPUT'] },
- [dispatch],
- );
- useHotkeys('Escape', closeCommandBar, { enabled: isOpen, enableOnFormTags: ['INPUT'] }, [
- dispatch,
- ]);
-
- return (
- closeCommandBar()}>
-
-
- );
-};
-
-export default CommandBar;
diff --git a/src/components/GlobalKeyboardListeners.tsx b/src/components/GlobalKeyboardListeners.tsx
index 7a77a979fb..c491dde7c0 100644
--- a/src/components/GlobalKeyboardListeners.tsx
+++ b/src/components/GlobalKeyboardListeners.tsx
@@ -1,13 +1,43 @@
-import React from 'react';
+import React, { useCallback } from 'react';
-import CommandBar from '@/components/CommandBar';
+import { useHotkeys } from 'react-hotkeys-hook';
+import { shallowEqual, useSelector, useDispatch } from 'react-redux';
+
+import { selectIsSearchDrawerOpen, toggleSearchDrawerIsOpen } from '@/redux/slices/navbar';
+import { logEvent } from '@/utils/eventLogger';
+
+const getPressedShortcut = (event: KeyboardEvent): string => {
+ let shortcut = '';
+ if (event.metaKey) {
+ shortcut = 'cmd';
+ } else if (event.ctrlKey) {
+ shortcut = 'ctrl';
+ }
+ return `${shortcut}_${event.key}`;
+};
const GlobalKeyboardListeners: React.FC = () => {
- return (
- <>
-
- >
+ const dispatch = useDispatch();
+ const isOpen = useSelector(selectIsSearchDrawerOpen, shallowEqual);
+ const toggleShowCommandBar = useCallback(
+ (event: KeyboardEvent) => {
+ // eslint-disable-next-line i18next/no-literal-string
+ logEvent(`search_drawer_${isOpen ? 'close' : 'open'}`, {
+ // eslint-disable-next-line @typescript-eslint/naming-convention
+ keyboard_shortcut: getPressedShortcut(event),
+ });
+ event.preventDefault();
+ dispatch({ type: toggleSearchDrawerIsOpen.type });
+ },
+ [dispatch, isOpen],
+ );
+ useHotkeys(
+ 'meta+k, ctrl+k, meta+p, ctrl+p',
+ toggleShowCommandBar,
+ { enableOnFormTags: ['INPUT'] },
+ [dispatch],
);
+ return <>>;
};
export default GlobalKeyboardListeners;
diff --git a/src/components/HomePage/HomePageHero.tsx b/src/components/HomePage/HomePageHero.tsx
index 5c1b115407..e3fb8093f5 100644
--- a/src/components/HomePage/HomePageHero.tsx
+++ b/src/components/HomePage/HomePageHero.tsx
@@ -1,24 +1,26 @@
import dynamic from 'next/dynamic';
import Head from 'next/head';
+import useTranslation from 'next-translate/useTranslation';
import styles from './HomePageHero.module.scss';
import QuickLinks from './QuickLinks';
-import CommandBarTrigger from '@/components/CommandBar/CommandBarTrigger';
+import SearchInput from '@/components/Search/SearchInput';
const PlayRadioButton = dynamic(() => import('./PlayRadioButton'));
const HomePageHero = () => {
+ const { t } = useTranslation('common');
return (
-
+
-
+
diff --git a/src/components/HomePage/PlayRadioButton.tsx b/src/components/HomePage/PlayRadioButton.tsx
index 5d9e2224ab..a2c5f00fc1 100644
--- a/src/components/HomePage/PlayRadioButton.tsx
+++ b/src/components/HomePage/PlayRadioButton.tsx
@@ -14,6 +14,7 @@ import Button, { ButtonType, ButtonSize } from '@/dls/Button/Button';
import Spinner from '@/dls/Spinner/Spinner';
import PauseIcon from '@/icons/pause.svg';
import PlayIcon from '@/icons/play-arrow.svg';
+import ThemeType from '@/redux/types/ThemeType';
import { logButtonClick } from '@/utils/eventLogger';
import { selectIsLoading } from 'src/xstate/actors/audioPlayer/selectors';
import { AudioPlayerMachineContext } from 'src/xstate/AudioPlayerMachineContext';
@@ -54,7 +55,7 @@ const PlayRadioButton = () => {
const { radioActor } = audioService.getSnapshot().context;
return (
-
+
{isAudioPlaying && isRadioMode ? (