Skip to content

Commit 0f268fe

Browse files
committed
Remove underscores from variables
1 parent 40cb060 commit 0f268fe

File tree

10 files changed

+42
-44
lines changed

10 files changed

+42
-44
lines changed

electron/src/renderer/src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default function App() {
1010
if (status === AppStatusType.start) {
1111
return <Start />
1212
}
13-
if (status === AppStatusType.get_started) {
13+
if (status === AppStatusType.getStarted) {
1414
return <GetStarted />
1515
}
1616
if (status === AppStatusType.main) {

electron/src/renderer/src/components/ActivateCard.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,12 @@ export default function ActivateCard({ goBackCallback }: ActivateCardPropsType)
6262
setUnexpectedError()
6363
} else {
6464
const activateErrorType = activateErrorData.code as APIErrorType
65-
if (activateErrorType === APIErrorType.license_used) {
65+
if (activateErrorType === APIErrorType.licenseUsed) {
6666
setError({
6767
title: "License already in use",
6868
desc: "It looks like this license is already active on another device. Please deactivate it on the other device or contact support if you think this is a mistake."
6969
})
70-
} else if (activateErrorType === APIErrorType.license_invalid) {
70+
} else if (activateErrorType === APIErrorType.licenseInvalid) {
7171
setError({
7272
title: "License key invalid",
7373
desc: "This license key is not valid, please try again. If you think this is a mistake, please contact support."

electron/src/renderer/src/components/get-started/LicenseCards.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ export default function LicenseCards({ setIsActivatePrompt }: LicenseCardsPropsT
133133
setUnexpectedError()
134134
} else {
135135
const activateErrorType = activateErrorData.code as APIErrorType
136-
if (activateErrorType === APIErrorType.free_trial_expired) {
136+
if (activateErrorType === APIErrorType.freeTrialExpired) {
137137
setError({
138138
title: "Free Trial expired",
139139
desc: "It looks like you've already used your free trial. Please consider purchasing and activating a license."

electron/src/renderer/src/components/main/about/AboutModal.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,10 @@ interface LicenseInfoPropsType {
145145
}
146146

147147
function LicenseInfo({ setIsDeactivateModalOpen, setIsActivateLicenseOpen }: LicenseInfoPropsType) {
148-
const { license_type, license_key_short } = useAppStore()
148+
const { licenseType, licenseKeyShort } = useAppStore()
149149

150150
let content
151-
if (license_type === LicenseType.full) {
151+
if (licenseType === LicenseType.full) {
152152
function handleDeactivateLicense() {
153153
setIsDeactivateModalOpen(true)
154154
}
@@ -157,7 +157,7 @@ function LicenseInfo({ setIsDeactivateModalOpen, setIsActivateLicenseOpen }: Lic
157157
<>
158158
<p className="font-medium">Full version</p>
159159
<p className="mt-1">
160-
License key: <span className="text-neutral-500">{license_key_short}</span>
160+
License key: <span className="text-neutral-500">{licenseKeyShort}</span>
161161
</p>
162162
<div className="mt-3 flex justify-center pb-6">
163163
<Button color="critical" size="xs" className={`${bodyBtnWidth}`} onClick={handleDeactivateLicense}>

electron/src/renderer/src/components/main/rename-photos/RenameErrorModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export default function RenameErrorModal({ isOpen, close, status }: RenameErrorM
7878
</>
7979
)
8080
} else {
81-
if (APIErrorType.free_trial_expired) {
81+
if (APIErrorType.freeTrialExpired) {
8282
errorTitle = "Free Trial used up"
8383
errorMsg = (
8484
<>

electron/src/renderer/src/components/main/rename-photos/RenameForm.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default function RenameForm() {
3131
const { isAddCustomText, customText, isValid: isCustomTextValid } = useCustomTextContext()
3232
const [isLoading, setIsLoading] = useState(false)
3333
const [status, setStatus] = useState<RenameStatusType | null>(null)
34-
const { license_type, free_trial_remaining, setFreeTrialRemaining, reset: resetAppStore } = useAppStore()
34+
const { licenseType, freeTrialRemaining, setFreeTrialRemaining, reset: resetAppStore } = useAppStore()
3535

3636
useEffect(() => {
3737
if (isLastFileRemoved) {
@@ -47,7 +47,7 @@ export default function RenameForm() {
4747
const renameBtnDisabled = !fileInput.imageFiles || !isCustomTextValid || isLoading
4848
const renameText = isLoading ? "Renaming..." : "Rename"
4949
let remainingTextStyle = "text-inherhit"
50-
if (free_trial_remaining <= 10) {
50+
if (freeTrialRemaining <= 10) {
5151
remainingTextStyle = "text-red-500 font-bold"
5252
}
5353
let dropZone = <EmptyDropZone isDisabled={isLoading} />
@@ -72,7 +72,7 @@ export default function RenameForm() {
7272
// Event handlers
7373
function handleErrorModalClose() {
7474
setStatus(null)
75-
if (license_type === LicenseType.demo && free_trial_remaining <= 0) {
75+
if (licenseType === LicenseType.demo && freeTrialRemaining <= 0) {
7676
resetAppStore()
7777
}
7878
}
@@ -124,9 +124,9 @@ export default function RenameForm() {
124124
}
125125

126126
if (updatedImageFiles.length > 0) {
127-
if (license_type === LicenseType.demo && updatedImageFiles.length > free_trial_remaining) {
127+
if (licenseType === LicenseType.demo && updatedImageFiles.length > freeTrialRemaining) {
128128
let slicedUpdatedImageFiles = new DataTransfer()
129-
for (let i = 0; i < free_trial_remaining; i++) {
129+
for (let i = 0; i < freeTrialRemaining; i++) {
130130
slicedUpdatedImageFiles.items.add(updatedImageFiles[i])
131131
}
132132

@@ -224,8 +224,8 @@ export default function RenameForm() {
224224
})
225225
fileInput.ref.current && (fileInput.ref.current.value = "")
226226

227-
if (license_type === LicenseType.demo) {
228-
setFreeTrialRemaining(free_trial_remaining - filePaths.length) // TODO: Replace this with data from backend API
227+
if (licenseType === LicenseType.demo) {
228+
setFreeTrialRemaining(freeTrialRemaining - filePaths.length) // TODO: Replace this with data from backend API
229229
}
230230
}
231231
)
@@ -243,11 +243,11 @@ export default function RenameForm() {
243243
<div>
244244
<h1 className="text-xl font-semibold text-neutral-800">Rename Photos</h1>
245245
<p className="mt-1 text-sm text-neutral-700">You can add photos in png, jpeg, and jpg format</p>
246-
{license_type === LicenseType.demo && (
246+
{licenseType === LicenseType.demo && (
247247
<div className={`mt-[0.75rem] flex items-center text-xs font-medium text-neutral-400`}>
248248
<p>
249-
<span className={`${remainingTextStyle}`}>{free_trial_remaining}</span>{" "}
250-
{free_trial_remaining === 1 ? "file" : "files"} remaining
249+
<span className={`${remainingTextStyle}`}>{freeTrialRemaining}</span>{" "}
250+
{freeTrialRemaining === 1 ? "file" : "files"} remaining
251251
</p>
252252
<p className="mx-1"></p>
253253
<ExternalLink
@@ -261,7 +261,7 @@ export default function RenameForm() {
261261
)}
262262
</div>
263263
{/* Form */}
264-
<div className={`${license_type === LicenseType.demo ? "mt-1" : "mt-8"} w-[35rem]`}>
264+
<div className={`${licenseType === LicenseType.demo ? "mt-1" : "mt-8"} w-[35rem]`}>
265265
{/* File Drop Zone */}
266266
<div className="flex w-full items-center justify-center">
267267
<Label

electron/src/renderer/src/components/start/ConnectStatus.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@ async function validateFreeTrial(
2424
setIsError(true)
2525
} else {
2626
const validateErrorType = validateErrorData.code as APIErrorType
27-
if (
28-
[APIErrorType.free_trial_expired, APIErrorType.free_trial_not_found].includes(validateErrorType)
29-
) {
27+
if ([APIErrorType.freeTrialExpired, APIErrorType.freeTrialNotFound].includes(validateErrorType)) {
3028
// no free trial -> let's validate license
3129
setIsReadyForValidateLicense(true)
3230
} else {
@@ -58,8 +56,8 @@ async function validateLicense(
5856
setIsError(true)
5957
} else {
6058
const validateErrorType = validateErrorData.code as APIErrorType
61-
if ([APIErrorType.license_not_found, APIErrorType.license_invalid].includes(validateErrorType)) {
62-
setStatus(AppStatusType.get_started)
59+
if ([APIErrorType.licenseNotFound, APIErrorType.licenseInvalid].includes(validateErrorType)) {
60+
setStatus(AppStatusType.getStarted)
6361
} else {
6462
// unexpected
6563
setIsError(true)

electron/src/renderer/src/pages/Main.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ registerUpdaterEvents()
1717

1818
export default function Main() {
1919
const { isOpen: isActivateLicenseOpen, setIsOpen: setIsActivateLicenseOpen } = useActivateLicenseStore()
20-
const { license_type } = useAppStore()
20+
const { licenseType } = useAppStore()
2121

22-
const isDemo = license_type === LicenseType.demo
22+
const isDemo = licenseType === LicenseType.demo
2323

2424
return (
2525
<>

electron/src/renderer/src/store/useAppStore.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import { AppStatusType, LicenseType } from "../utils/enums"
44

55
interface AppStoreStatesType {
66
status: AppStatusType
7-
license_type: LicenseType | null
8-
license_key_short: string | null
9-
free_trial_remaining: number
7+
licenseType: LicenseType | null
8+
licenseKeyShort: string | null
9+
freeTrialRemaining: number
1010
}
1111

1212
interface AppStoreActions {
@@ -19,17 +19,17 @@ interface AppStoreActions {
1919

2020
const initialStates: AppStoreStatesType = {
2121
status: AppStatusType.start,
22-
license_type: null,
23-
license_key_short: null,
24-
free_trial_remaining: 0
22+
licenseType: null,
23+
licenseKeyShort: null,
24+
freeTrialRemaining: 0
2525
}
2626

2727
export const useAppStore = create<AppStoreStatesType & AppStoreActions>()((set) => ({
2828
...initialStates,
2929
setStatus: (status) => set({ status: status }),
30-
setLicenseType: (type) => set({ license_type: type }),
31-
setLicenseKeyShort: (key) => set({ license_key_short: key }),
32-
setFreeTrialRemaining: (remaining) => set({ free_trial_remaining: remaining }),
30+
setLicenseType: (type) => set({ licenseType: type }),
31+
setLicenseKeyShort: (key) => set({ licenseKeyShort: key }),
32+
setFreeTrialRemaining: (remaining) => set({ freeTrialRemaining: remaining }),
3333
reset: () => {
3434
set(initialStates)
3535
}

electron/src/renderer/src/utils/enums.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ export enum APIErrorType {
99
// rename
1010
invalidFileType = 1,
1111
noExifData = 2,
12-
invalid_option = 3,
13-
no_access = 4,
12+
invalidOption = 3,
13+
noAccess = 4,
1414
// license
15-
license_used = 100,
16-
license_invalid = 101,
17-
license_not_found = 102,
15+
licenseUsed = 100,
16+
licenseInvalid = 101,
17+
licenseNotFound = 102,
1818
// free trial
19-
free_trial_expired = 200,
20-
free_trial_files_exceeded = 201,
21-
free_trial_not_found = 201
19+
freeTrialExpired = 200,
20+
freeTrialFilesExceeded = 201,
21+
freeTrialNotFound = 201
2222
}
2323

2424
export enum UpdateStatusType {
@@ -31,7 +31,7 @@ export enum UpdateStatusType {
3131

3232
export enum AppStatusType {
3333
start,
34-
get_started,
34+
getStarted,
3535
main
3636
}
3737

0 commit comments

Comments
 (0)