-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from deriv-com/farabi/grwt-4936/desktop-and-mo…
…bile-layout Farabi/grwt 4936/desktop and mobile layout
- Loading branch information
Showing
24 changed files
with
509 additions
and
323 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,25 @@ | ||
import { BarChart2, Clock, Expand } from 'lucide-react'; | ||
import { AreaChart } from 'lucide-react'; | ||
|
||
interface DurationOptionsProps { | ||
className?: string; | ||
} | ||
|
||
export const DurationOptions: React.FC<DurationOptionsProps> = ({ className = '' }) => { | ||
return ( | ||
<div className={`flex items-center justify-between p-4 border-t border-b ${className}`}> | ||
<div className={`flex items-center p-4 ${className}`}> | ||
<div className="flex items-center gap-4 pr-4"> | ||
<button className="text-gray-600 hover:text-gray-700" aria-label="chart"> | ||
<AreaChart className="w-5 h-5" /> | ||
</button> | ||
<div className='w-0.5 h-5 bg-gray-100'></div> | ||
</div> | ||
<div className="flex items-center gap-4"> | ||
<button className="text-sm font-medium text-primary">1t</button> | ||
<button className="text-sm font-medium text-gray-500">1m</button> | ||
<button className="text-sm font-medium text-gray-500">2m</button> | ||
<button className="text-sm font-medium text-gray-500">3m</button> | ||
<button className="text-sm font-medium text-gray-500">5m</button> | ||
</div> | ||
<div className="flex items-center gap-4"> | ||
<button className="text-gray-500 hover:text-gray-700" aria-label="chart"> | ||
<BarChart2 className="w-5 h-5" /> | ||
</button> | ||
<button className="text-gray-500 hover:text-gray-700" aria-label="clock"> | ||
<Clock className="w-5 h-5" /> | ||
</button> | ||
<button className="text-gray-500 hover:text-gray-700" aria-label="expand"> | ||
<Expand className="w-5 h-5" /> | ||
</button> | ||
</div> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import React from "react"; | ||
import { useBottomSheetStore } from "@/stores/bottomSheetStore"; | ||
|
||
export const HowToTrade: React.FC = () => { | ||
const { setBottomSheet } = useBottomSheetStore(); | ||
|
||
const handleClick = () => { | ||
setBottomSheet(true, "how-to-trade", '800px'); | ||
}; | ||
|
||
return ( | ||
<button | ||
onClick={handleClick} | ||
className="text-gray-500 hover:text-gray-600 text-sm flex items-center gap-1" | ||
> | ||
How to trade Rise/Fall? | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
fill="none" | ||
viewBox="0 0 24 24" | ||
strokeWidth={1.5} | ||
stroke="currentColor" | ||
className="w-4 h-4" | ||
> | ||
<path | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
d="M8.25 4.5l7.5 7.5-7.5 7.5" | ||
/> | ||
</svg> | ||
</button> | ||
); | ||
}; | ||
|
||
export default HowToTrade; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { render, screen, fireEvent } from '@testing-library/react'; | ||
import HowToTrade from '../HowToTrade'; | ||
|
||
const mockSetBottomSheet = jest.fn(); | ||
|
||
// Mock the bottomSheetStore | ||
jest.mock('@/stores/bottomSheetStore', () => ({ | ||
useBottomSheetStore: () => ({ | ||
setBottomSheet: mockSetBottomSheet | ||
}) | ||
})); | ||
|
||
describe('HowToTrade', () => { | ||
beforeEach(() => { | ||
mockSetBottomSheet.mockClear(); | ||
}); | ||
|
||
it('renders correctly', () => { | ||
render(<HowToTrade />); | ||
expect(screen.getByText('How to trade Rise/Fall?')).toBeInTheDocument(); | ||
}); | ||
|
||
it('opens bottom sheet when clicked', () => { | ||
render(<HowToTrade />); | ||
fireEvent.click(screen.getByText('How to trade Rise/Fall?')); | ||
expect(mockSetBottomSheet).toHaveBeenCalledWith(true, 'how-to-trade', '800px'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from './HowToTrade'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.