refactor: PrimaryButton to Button

This commit is contained in:
Mahyar Khanbolooki
2025-07-01 01:41:19 +03:30
parent 9b1333fcf5
commit a26923f455
5 changed files with 11 additions and 11 deletions
+3 -3
View File
@@ -2,12 +2,12 @@ import React from 'react'
type Props = {} & React.ButtonHTMLAttributes<HTMLButtonElement>; type Props = {} & React.ButtonHTMLAttributes<HTMLButtonElement>;
function PrimaryButton({ children, className, ...rest }: Props) { function Button({ children, className, ...rest }: Props) {
return ( return (
<button className={`${className} bg-primary w-full rounded-normal p-3 text-white font-bold text-sm`} {...rest}> <button className={`${className} cursor-pointer bg-primary w-full rounded-normal p-3 text-white font-bold text-sm`} {...rest}>
{children} {children}
</button> </button>
) )
} }
export default PrimaryButton export default Button
@@ -1,4 +1,4 @@
import PrimaryButton from '@/components/button/PrimaryButton'; import Button from '@/components/button/PrimaryButton';
import InputField from '@/components/input/InputField'; import InputField from '@/components/input/InputField';
import { AUTH_PAGE_ELEMENT } from '@/enums'; import { AUTH_PAGE_ELEMENT } from '@/enums';
import React from 'react' import React from 'react'
@@ -27,7 +27,7 @@ function StepEnterNumber({ onSubmit, onChange, value }: Props) {
onChange={onChange} onChange={onChange}
type='number' /> type='number' />
</div> </div>
<PrimaryButton type='submit'>بعدی</PrimaryButton> <Button type='submit'>بعدی</Button>
</form> </form>
) )
} }
@@ -1,4 +1,4 @@
import PrimaryButton from '@/components/button/PrimaryButton'; import Button from '@/components/button/PrimaryButton';
import OTPInputField from '@/components/input/MultiInputField'; import OTPInputField from '@/components/input/MultiInputField';
import { AUTH_PAGE_ELEMENT, AUTH_PAGE_ELEMENT as AUTH_PAGE_ELEMENTS } from '@/enums'; import { AUTH_PAGE_ELEMENT, AUTH_PAGE_ELEMENT as AUTH_PAGE_ELEMENTS } from '@/enums';
import React from 'react' import React from 'react'
@@ -51,7 +51,7 @@ function StepEnterOtp({ onSubmit, onChange, onClick, value, phoneNumber, timerRu
</div> </div>
</div> </div>
</div> </div>
<PrimaryButton type='submit'>بعدی</PrimaryButton> <Button type='submit'>بعدی</Button>
</form> </form>
) )
} }
@@ -1,4 +1,4 @@
import PrimaryButton from '@/components/button/PrimaryButton'; import Button from '@/components/button/PrimaryButton';
import { EyeToggleIcon } from '@/components/icons/EyeToggleIcon'; import { EyeToggleIcon } from '@/components/icons/EyeToggleIcon';
import InputField from '@/components/input/InputField'; import InputField from '@/components/input/InputField';
import { AUTH_PAGE_ELEMENT } from '@/enums'; import { AUTH_PAGE_ELEMENT } from '@/enums';
@@ -43,7 +43,7 @@ function StepEnterPassword({ onSubmit, onChange, onClick, value, passwordVisible
<input id={AUTH_PAGE_ELEMENT.INPUT_REMEMBER_ME} className='h-4.5 w-4.5 checked:accent-primary' onChange={onChange} type='checkbox' checked={rememberMe} /> </div> <input id={AUTH_PAGE_ELEMENT.INPUT_REMEMBER_ME} className='h-4.5 w-4.5 checked:accent-primary' onChange={onChange} type='checkbox' checked={rememberMe} /> </div>
</div> </div>
</div> </div>
<PrimaryButton type='submit'>ورود به منو</PrimaryButton> <Button type='submit'>ورود به منو</Button>
</form> </form>
) )
} }
@@ -1,4 +1,4 @@
import PrimaryButton from '@/components/button/PrimaryButton'; import Button from '@/components/button/PrimaryButton';
import { EyeToggleIcon } from '@/components/icons/EyeToggleIcon'; import { EyeToggleIcon } from '@/components/icons/EyeToggleIcon';
import InputField from '@/components/input/InputField'; import InputField from '@/components/input/InputField';
import { AUTH_PAGE_ELEMENT } from '@/enums'; import { AUTH_PAGE_ELEMENT } from '@/enums';
@@ -52,7 +52,7 @@ function StepNewPassword({ reset = false, onSubmit, onChange, onClick, value, re
</button> </button>
</InputField> </InputField>
</div> </div>
<PrimaryButton type='submit'>ورود</PrimaryButton> <Button type='submit'>ورود</Button>
</form> </form>
) )
} }