Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use medium button by default #47238

Merged
merged 9 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/components/AnonymousReportFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ function AnonymousReportFooter({isSmallSizeLayout = false, report, policy}: Anon
</View>
<View style={[styles.anonymousRoomFooterSignInButton]}>
<Button
medium
success
text={translate('common.signIn')}
onPress={() => Session.signOutAndRedirectToSignIn()}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ function Button(

small = false,
large = false,
medium = false,
medium = !small && !large,

isLoading = false,
isDisabled = false,
Expand Down
2 changes: 0 additions & 2 deletions src/components/ConfirmContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,6 @@ function ConfirmContent({
style={[styles.noSelect, styles.flex1]}
onPress={onCancel}
text={cancelText || translate('common.no')}
medium
/>
)}
<Button
Expand All @@ -231,7 +230,6 @@ function ConfirmContent({
pressOnEnter
text={confirmText || translate('common.yes')}
isDisabled={isOffline && shouldDisableConfirmButtonWhenOffline}
medium
/>
</View>
)}
Expand Down
1 change: 0 additions & 1 deletion src/components/ImportSpreadsheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ function ImportSpreedsheet({backTo, goTo}: ImportSpreedsheetProps) {
<FilePicker acceptableFileTypes={CONST.ALLOWED_SPREADSHEET_EXTENSIONS.map((extension) => `.${extension}`).join(',')}>
{({openPicker}) => (
<Button
medium
success
text={translate('common.chooseFile')}
accessibilityLabel={translate('common.chooseFile')}
Expand Down
1 change: 0 additions & 1 deletion src/components/MapView/MapView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,6 @@ const MapView = forwardRef<MapViewHandle, ComponentProps>(
<Button
onPress={centerMap}
iconFill={theme.icon}
medium
icon={Expensicons.Crosshair}
accessibilityLabel={translate('common.center')}
/>
Expand Down
1 change: 0 additions & 1 deletion src/components/MapView/MapView.website.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,6 @@ const MapView = forwardRef<MapViewHandle, ComponentProps>(
<Button
onPress={centerMap}
iconFill={theme.icon}
medium
icon={Expensicons.Crosshair}
accessibilityLabel={translate('common.center')}
/>
Expand Down
4 changes: 0 additions & 4 deletions src/components/MoneyReportHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,6 @@ function MoneyReportHeader({policy, report: moneyRequestReport, transactionThrea
{shouldShowSubmitButton && !shouldUseNarrowLayout && (
<View style={styles.pv2}>
<Button
medium
success={isWaitingForSubmissionFromCurrentUser}
text={translate('common.submit')}
style={[styles.mnw120, styles.pv2, styles.pr0]}
Expand All @@ -331,7 +330,6 @@ function MoneyReportHeader({policy, report: moneyRequestReport, transactionThrea
{hasAllPendingRTERViolations && !shouldUseNarrowLayout && (
<View style={[styles.pv2]}>
<Button
medium
success
text={translate('iou.markAsCash')}
style={[styles.pv2, styles.pr0]}
Expand Down Expand Up @@ -369,7 +367,6 @@ function MoneyReportHeader({policy, report: moneyRequestReport, transactionThrea
)}
{shouldShowSubmitButton && shouldUseNarrowLayout && (
<Button
medium
success={isWaitingForSubmissionFromCurrentUser}
text={translate('common.submit')}
style={[styles.w100, styles.pr0]}
Expand All @@ -379,7 +376,6 @@ function MoneyReportHeader({policy, report: moneyRequestReport, transactionThrea
)}
{hasAllPendingRTERViolations && shouldUseNarrowLayout && (
<Button
medium
success
text={translate('iou.markAsCash')}
style={[styles.w100, styles.pr0]}
Expand Down
4 changes: 0 additions & 4 deletions src/components/MoneyRequestHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ function MoneyRequestHeader({report, parentReportAction, policy, shouldUseNarrow
{hasAllPendingRTERViolations && !shouldUseNarrowLayout && (
<Button
success
medium
text={translate('iou.markAsCash')}
style={[styles.p0]}
onPress={markAsCash}
Expand All @@ -147,7 +146,6 @@ function MoneyRequestHeader({report, parentReportAction, policy, shouldUseNarrow
{isDuplicate && !shouldUseNarrowLayout && (
<Button
success
medium
text={translate('iou.reviewDuplicates')}
style={[styles.p0, styles.ml2]}
onPress={() => {
Expand All @@ -159,7 +157,6 @@ function MoneyRequestHeader({report, parentReportAction, policy, shouldUseNarrow
{hasAllPendingRTERViolations && shouldUseNarrowLayout && (
<View style={[styles.ph5, styles.pb3]}>
<Button
medium
success
text={translate('iou.markAsCash')}
style={[styles.w100, styles.pr0]}
Expand All @@ -171,7 +168,6 @@ function MoneyRequestHeader({report, parentReportAction, policy, shouldUseNarrow
<View style={[styles.ph5, styles.pb3]}>
<Button
success
medium
text={translate('iou.reviewDuplicates')}
style={[styles.w100, styles.pr0]}
onPress={() => {
Expand Down
1 change: 0 additions & 1 deletion src/components/PromotedActionsBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ function PromotedActionsBar({promotedActions, containerStyle}: PromotedActionsBa
<Button
onPress={onSelected}
iconFill={theme.icon}
medium
// eslint-disable-next-line react/jsx-props-no-spreading
{...props}
/>
Expand Down
1 change: 0 additions & 1 deletion src/components/ReportActionItem/IssueCardMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ function IssueCardMessage({action, policyID}: IssueCardMessageProps) {
Navigation.navigate(ROUTES.MISSING_PERSONAL_DETAILS.getRoute(policyID));
}}
success
medium
style={[styles.alignSelfStart, styles.mt3]}
text={translate('workspace.expensifyCard.addShippingDetails')}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,6 @@ function MoneyRequestPreviewContent({
<Button
text={translate('violations.keepThisOne')}
success
medium
style={styles.p4}
onPress={navigateToReviewFields}
/>
Expand Down
1 change: 0 additions & 1 deletion src/components/ReportActionItem/ReportPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,6 @@ function ReportPreview({
)}
{shouldShowSubmitButton && (
<Button
medium
success={isWaitingForSubmissionFromCurrentUser}
text={translate('common.submit')}
onPress={() => iouReport && IOU.submitReport(iouReport)}
Expand Down
1 change: 0 additions & 1 deletion src/components/ReportActionItem/TripRoomPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ function TripRoomPreview({action, chatReportID, containerStyles, contextMenuAnch
renderItem={renderItem}
/>
<Button
medium
success
text={translate('travel.viewTrip')}
onPress={() => Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(chatReportID))}
Expand Down
1 change: 0 additions & 1 deletion src/components/Search/SearchPageHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,6 @@ function SearchPageHeader({queryJSON, hash, onSelectDeleteOption, setOfflineModa
text={translate('search.filtersHeader')}
icon={Expensicons.Filters}
onPress={onPress}
medium
/>
)}
</HeaderWrapper>
Expand Down
1 change: 0 additions & 1 deletion src/components/Search/SearchStatusBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ function SearchStatusBar({type, status, resetOffset}: SearchStatusBarProps) {
textHoverStyles={StyleUtils.getTextColorStyle(theme.text)}
// We add padding to the first and last items so that they align with the header and table but can overflow outside the screen when scrolled.
style={[isFirstItem && styles.pl5, isLastItem && styles.pr5]}
medium
/>
);
})}
Expand Down
1 change: 0 additions & 1 deletion src/components/TaskHeaderActionButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ function TaskHeaderActionButton({report, session}: TaskHeaderActionButtonProps)
<Button
success
isDisabled={!Task.canModifyTask(report, session?.accountID ?? -1)}
medium
text={translate(ReportUtils.isCompletedTaskReport(report) ? 'task.markAsIncomplete' : 'task.markAsComplete')}
onPress={Session.checkIfActionIsAllowed(() => {
// If we're already navigating to these task editing pages, early return not to mark as completed, otherwise we would have not found page.
Expand Down
2 changes: 0 additions & 2 deletions src/pages/ErrorPage/GenericErrorPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,11 @@ function GenericErrorPage() {
<View style={[styles.flex1, styles.flexRow]}>
<Button
success
medium
onPress={resetBoundary}
text={translate('genericErrorPage.refresh')}
style={styles.mr3}
/>
<Button
medium
onPress={() => {
Session.signOutAndRedirectToSignIn();
resetBoundary();
Expand Down
1 change: 0 additions & 1 deletion src/pages/ReportParticipantDetailsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ function ReportParticipantDetails({personalDetails, report, route}: ReportPartic
<Button
text={translate('workspace.people.removeGroupMemberButtonTitle')}
onPress={() => setIsRemoveMemberConfirmModalVisible(true)}
medium
isDisabled={isSelectedMemberCurrentUser}
icon={Expensicons.RemoveMembers}
iconStyles={StyleUtils.getTransformScaleStyle(0.8)}
Expand Down
1 change: 0 additions & 1 deletion src/pages/ReportParticipantsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,6 @@ function ReportParticipantsPage({report}: WithReportOrNotFoundProps) {
/>
) : (
<Button
medium
success
onPress={inviteUser}
text={translate('workspace.invite.member')}
Expand Down
1 change: 0 additions & 1 deletion src/pages/RoomMemberDetailsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ function RoomMemberDetailsPage({report, route}: RoomMemberDetailsPagePageProps)
<Button
text={translate('workspace.people.removeRoomMemberButtonTitle')}
onPress={() => setIsRemoveMemberConfirmModalVisible(true)}
medium
isDisabled={isSelectedMemberCurrentUser}
icon={Expensicons.RemoveMembers}
iconStyles={StyleUtils.getTransformScaleStyle(0.8)}
Expand Down
1 change: 0 additions & 1 deletion src/pages/RoomMembersPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,6 @@ function RoomMembersPage({report, session, policies}: RoomMembersPageProps) {
/>
) : (
<Button
medium
success
onPress={inviteUser}
text={translate('workspace.invite.member')}
Expand Down
1 change: 0 additions & 1 deletion src/pages/home/HeaderView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ function HeaderView({report, parentReportAction, reportID, onNavigationMenuButto
const joinButton = (
<Button
success
medium
text={translate('common.join')}
onPress={join}
/>
Expand Down
1 change: 0 additions & 1 deletion src/pages/home/report/ReportActionItemMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ function ReportActionItemMessage({action, transaction, displayAsGroup, reportID,
{action.actionName === CONST.REPORT.ACTIONS.TYPE.IOU && ReportUtils.hasMissingInvoiceBankAccount(reportID) && (
<Button
style={[styles.mt2, styles.alignSelfStart]}
medium
success
text={translate('workspace.invoices.paymentMethods.addBankAccount')}
onPress={openWorkspaceInvoicesPage}
Expand Down
1 change: 0 additions & 1 deletion src/pages/home/sidebar/SignInButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ function SignInButton() {
>
<View style={styles.signInButtonAvatar}>
<Button
medium
success
text={translate('common.signIn')}
onPress={() => Session.signOutAndRedirectToSignIn()}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,6 @@ function IOURequestStepScan({
<Text style={[styles.textFileUpload]}>{translate('receipt.takePhoto')}</Text>
<Text style={[styles.subTextFileUpload]}>{translate('receipt.cameraAccess')}</Text>
<Button
medium
success
text={translate('common.continue')}
accessibilityLabel={translate('common.continue')}
Expand Down
2 changes: 0 additions & 2 deletions src/pages/iou/request/step/IOURequestStepScan/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,6 @@ function IOURequestStepScan({
<Text style={[styles.textFileUpload]}>{translate('receipt.takePhoto')}</Text>
<Text style={[styles.subTextFileUpload]}>{translate('receipt.cameraAccess')}</Text>
<Button
medium
success
text={translate('common.continue')}
accessibilityLabel={translate('common.continue')}
Expand Down Expand Up @@ -677,7 +676,6 @@ function IOURequestStepScan({
<AttachmentPicker>
{({openPicker}) => (
<Button
medium
success
text={translate('common.chooseFile')}
accessibilityLabel={translate('common.chooseFile')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ function SaveWithExpensifyButton() {
<Button
text={translate('subscription.yourPlan.saveWithExpensifyButton')}
onPress={onLinkPress}
medium
/>
);
}
Expand Down
2 changes: 0 additions & 2 deletions src/pages/settings/Wallet/ExpensifyCardPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ function ExpensifyCardPage({
/>

<Button
medium
style={[styles.mh5, styles.mb5]}
text={translate('cardPage.reviewTransaction')}
onPress={() => Link.openOldDotLink(CONST.OLDDOT_URLS.INBOX)}
Expand Down Expand Up @@ -242,7 +241,6 @@ function ExpensifyCardPage({
shouldShowRightComponent
rightComponent={
<Button
medium
text={translate('cardPage.cardDetails.revealDetails')}
onPress={() => openValidateCodeModal(card.cardID)}
isDisabled={isCardDetailsLoading[card.cardID] || isOffline}
Expand Down
1 change: 0 additions & 1 deletion src/pages/signin/UnlinkLoginForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ function UnlinkLoginForm({account, credentials}: UnlinkLoginFormProps) {
<Text style={[styles.link]}>{translate('common.back')}</Text>
</PressableWithFeedback>
<Button
medium
success
text={translate('unlinkLoginForm.unlink')}
isLoading={account?.isLoading && account.loadingForm === CONST.FORMS.UNLINK_LOGIN_FORM}
Expand Down
1 change: 0 additions & 1 deletion src/pages/workspace/WorkspaceMembersPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,6 @@ function WorkspaceMembersPage({personalDetails, route, policy, currentUserPerson
/>
) : (
<Button
medium
success
onPress={inviteUser}
text={translate('workspace.invite.member')}
Expand Down
2 changes: 0 additions & 2 deletions src/pages/workspace/WorkspaceProfilePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,6 @@ function WorkspaceProfilePage({policyDraft, policy: policyProp, currencyList = {
accessibilityLabel={translate('common.share')}
text={translate('common.share')}
onPress={onPressShare}
medium
icon={Expensicons.QrCode}
/>
{isOwner && (
Expand All @@ -279,7 +278,6 @@ function WorkspaceProfilePage({policyDraft, policy: policyProp, currencyList = {
text={translate('common.delete')}
style={[styles.ml2]}
onPress={() => setIsDeleteModalOpen(true)}
medium
icon={Expensicons.Trashcan}
/>
)}
Expand Down
1 change: 0 additions & 1 deletion src/pages/workspace/WorkspacesListPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,6 @@ function WorkspacesListPage({policies, reimbursementAccount, reports, session}:
<Button
accessibilityLabel={translate('workspace.new.newWorkspace')}
success
medium
text={translate('workspace.new.newWorkspace')}
onPress={() => interceptAnonymousUser(() => App.createWorkspaceWithPolicyDraftAndNavigateToIt())}
icon={Expensicons.Plus}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ function WorkspaceCardCreateAWorkspace() {
text={translate('workspace.emptyWorkspace.createAWorkspaceCTA')}
style={styles.mt5}
success
medium
/>
</Section>
);
Expand Down
2 changes: 0 additions & 2 deletions src/pages/workspace/categories/WorkspaceCategoriesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,6 @@ function WorkspaceCategoriesPage({route}: WorkspaceCategoriesPageProps) {
<View style={[styles.flexRow, styles.gap2, shouldUseNarrowLayout && styles.mb3]}>
{!PolicyUtils.hasAccountingConnections(policy) && (
<Button
medium
success
onPress={navigateToCreateCategoryPage}
icon={Expensicons.Plus}
Expand All @@ -256,7 +255,6 @@ function WorkspaceCategoriesPage({route}: WorkspaceCategoriesPageProps) {
/>
)}
<Button
medium
onPress={navigateToCategoriesSettings}
icon={Expensicons.Gear}
text={translate('common.settings')}
Expand Down
Loading
Loading