Skip to content

Commit 8c42672

Browse files
authored
Merge pull request #40 from abhinav-1305/feature/add-tooltips
feat: add title attributes to buttons
2 parents 5a771b0 + f44407b commit 8c42672

6 files changed

Lines changed: 20 additions & 2 deletions

File tree

src/components/Cards/product-card.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ export const ProductCard: React.FC<ProductCardProps> = ({
7373
<Button
7474
className="bg-blue-400 hover:bg-blue-500 dark:bg-blue-600 dark:hover:bg-blue-700 text-white text-sm px-6 py-2.5 rounded-full font-medium transition-colors duration-200 shadow-sm hover:shadow-md cursor-pointer"
7575
onClick={handleDemoButtonClick}
76+
title="View Demo"
7677
>
7778
Demo
7879
</Button>

src/pages/Home.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export const Home = () => {
5353
<a
5454
href="#demos"
5555
className="inline-block px-8 py-3 bg-blue-600 hover:bg-blue-700 text-white font-semibold rounded-lg shadow transition-all text-lg"
56+
title="Scroll to demos section"
5657
>
5758
View Demos
5859
</a>

src/pages/demo-list/mifosx.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ export default function MifosXDemos() {
5858
<Button
5959
className="bg-blue-500 text-white px-3 py-1 rounded text-sm hover:bg-blue-600 cursor-pointer"
6060
onClick={() => NavigateToDemo(id, demoName)}
61+
title="Start this demo"
6162
>
6263
Start Demo
6364
</Button>
@@ -161,6 +162,7 @@ export default function MifosXDemos() {
161162
onClick={() => table.setPageIndex(0)}
162163
disabled={!table.getCanPreviousPage()}
163164
className="p-2 disabled:opacity-50 disabled:cursor-not-allowed"
165+
title="First page"
164166
>
165167
<ChevronsLeft className="h-4 w-4" />
166168
</Button>
@@ -171,6 +173,7 @@ export default function MifosXDemos() {
171173
onClick={() => table.previousPage()}
172174
disabled={!table.getCanPreviousPage()}
173175
className="p-2 disabled:opacity-50 disabled:cursor-not-allowed"
176+
title="Previous page"
174177
>
175178
<ChevronLeft className="h-4 w-4" />
176179
</Button>
@@ -181,6 +184,7 @@ export default function MifosXDemos() {
181184
onClick={() => table.nextPage()}
182185
disabled={!table.getCanNextPage()}
183186
className="p-2 disabled:opacity-50 disabled:cursor-not-allowed"
187+
title="Next page"
184188
>
185189
<ChevronRight className="h-4 w-4" />
186190
</Button>
@@ -191,6 +195,7 @@ export default function MifosXDemos() {
191195
onClick={() => table.setPageIndex(table.getPageCount() - 1)}
192196
disabled={!table.getCanNextPage()}
193197
className="p-2 disabled:opacity-50 disabled:cursor-not-allowed"
198+
title="Last page"
194199
>
195200
<ChevronsRight className="h-4 w-4" />
196201
</Button>

src/pages/demo-list/phee.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export default function PheeDemos() {
3939
id: 'action',
4040
header: '',
4141
cell: () => (
42-
<Button className="bg-blue-500 text-white px-3 py-1 rounded text-sm hover:bg-blue-600 cursor-pointer">
42+
<Button className="bg-blue-500 text-white px-3 py-1 rounded text-sm hover:bg-blue-600 cursor-pointer" title="Start this demo">
4343
Start Demo
4444
</Button>
4545
),
@@ -129,6 +129,7 @@ export default function PheeDemos() {
129129
onClick={() => table.setPageIndex(0)}
130130
disabled={!table.getCanPreviousPage()}
131131
className="p-2 disabled:opacity-50 disabled:cursor-not-allowed"
132+
title="First page"
132133
>
133134
<ChevronsLeft className="h-4 w-4" />
134135
</Button>
@@ -139,6 +140,7 @@ export default function PheeDemos() {
139140
onClick={() => table.previousPage()}
140141
disabled={!table.getCanPreviousPage()}
141142
className="p-2 disabled:opacity-50 disabled:cursor-not-allowed"
143+
title="Previous page"
142144
>
143145
<ChevronLeft className="h-4 w-4" />
144146
</Button>
@@ -149,6 +151,7 @@ export default function PheeDemos() {
149151
onClick={() => table.nextPage()}
150152
disabled={!table.getCanNextPage()}
151153
className="p-2 disabled:opacity-50 disabled:cursor-not-allowed"
154+
title="Next page"
152155
>
153156
<ChevronRight className="h-4 w-4" />
154157
</Button>
@@ -159,6 +162,7 @@ export default function PheeDemos() {
159162
onClick={() => table.setPageIndex(table.getPageCount() - 1)}
160163
disabled={!table.getCanNextPage()}
161164
className="p-2 disabled:opacity-50 disabled:cursor-not-allowed"
165+
title="Last page"
162166
>
163167
<ChevronsRight className="h-4 w-4" />
164168
</Button>

src/pages/demo-list/vnext.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export default function MifosXDemos() {
3939
id: 'action',
4040
header: '',
4141
cell: () => (
42-
<Button className="bg-blue-500 text-white px-3 py-1 rounded text-sm hover:bg-blue-600 cursor-pointer">
42+
<Button className="bg-blue-500 text-white px-3 py-1 rounded text-sm hover:bg-blue-600 cursor-pointer" title="Start this demo">
4343
Start Demo
4444
</Button>
4545
),
@@ -129,6 +129,7 @@ export default function MifosXDemos() {
129129
onClick={() => table.setPageIndex(0)}
130130
disabled={!table.getCanPreviousPage()}
131131
className="p-2 disabled:opacity-50 disabled:cursor-not-allowed"
132+
title="First page"
132133
>
133134
<ChevronsLeft className="h-4 w-4" />
134135
</Button>
@@ -139,6 +140,7 @@ export default function MifosXDemos() {
139140
onClick={() => table.previousPage()}
140141
disabled={!table.getCanPreviousPage()}
141142
className="p-2 disabled:opacity-50 disabled:cursor-not-allowed"
143+
title="Previous page"
142144
>
143145
<ChevronLeft className="h-4 w-4" />
144146
</Button>
@@ -149,6 +151,7 @@ export default function MifosXDemos() {
149151
onClick={() => table.nextPage()}
150152
disabled={!table.getCanNextPage()}
151153
className="p-2 disabled:opacity-50 disabled:cursor-not-allowed"
154+
title="Next page"
152155
>
153156
<ChevronRight className="h-4 w-4" />
154157
</Button>
@@ -159,6 +162,7 @@ export default function MifosXDemos() {
159162
onClick={() => table.setPageIndex(table.getPageCount() - 1)}
160163
disabled={!table.getCanNextPage()}
161164
className="p-2 disabled:opacity-50 disabled:cursor-not-allowed"
165+
title="Last page"
162166
>
163167
<ChevronsRight className="h-4 w-4" />
164168
</Button>

src/pages/demo/demo-page.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ export const DemoPage = () => {
116116
onClick={handlePrevious}
117117
disabled={currentStep === 0}
118118
className="flex items-center gap-2 px-4 py-2 text-gray-600 bg-gray-100 rounded-lg hover:bg-gray-200 disabled:opacity-50 disabled:cursor-not-allowed transition-colors cursor-pointer"
119+
title="Go to previous step"
119120
>
120121
<ChevronLeft size={16} />
121122
Previous
@@ -124,6 +125,7 @@ export const DemoPage = () => {
124125
onClick={handleNext}
125126
disabled={currentStep === SampleDemoJsonFile.steps.length - 1}
126127
className="flex items-center gap-2 px-4 py-2 text-white bg-blue-600 rounded-lg hover:bg-blue-700 dark:bg-blue-500 disabled:opacity-50 disabled:cursor-not-allowed transition-colors cursor-pointer"
128+
title="Go to next step"
127129
>
128130
Next
129131
<ChevronRight size={16} />
@@ -144,6 +146,7 @@ export const DemoPage = () => {
144146
? 'bg-blue-100 border-blue-300 text-blue-800 dark:text-gray-600'
145147
: 'bg-gray-50 border-gray-200 text-gray-700 hover:bg-gray-100 dark:bg-gray-800 dark:border-gray-800 dark:hover:bg-gray-900 dark:text-gray-300'
146148
}`}
149+
title={`Go to step: ${step.title}`}
147150
>
148151
<div className="flex items-center gap-3">
149152
<div

0 commit comments

Comments
 (0)