diff --git a/client/components/Remote.js b/client/components/Remote.js index b7b1fa7..b574efd 100644 --- a/client/components/Remote.js +++ b/client/components/Remote.js @@ -41,7 +41,8 @@ const Remote = (props) => {

- {props.remoteType}: {props.displayName} + {props.remoteType.charAt(0).toUpperCase() + + props.remoteType.slice(1)}: {props.displayName}

{/*
{ placeholder=" " required name="accessId" - id="originAccessId" + id={`${remoteType}AccessId`} onChange={(e) => { const newState = props.accessIdHandler(e, remote); dispatch(updateAccessId({ newState, remoteType })); }} >
@@ -93,10 +95,10 @@ const Remote = (props) => { required type="key" name="secretKey" - id="originSecretKey" + id={`${remote}SecretKey`} onChange={(e) => { const newState = props.secretKeyHandler(e, remote); - dispatch(updateSecretKey({newState, remoteType})); + dispatch(updateSecretKey({ newState, remoteType })); }} > @@ -104,7 +106,8 @@ const Remote = (props) => { htmlFor="secretKey" className="peer-focus:font-medium absolute text-base duration-300 transform -translate-y-6 scale-75 top-3 -z-10 origin-[0] peer-focus:left-0 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6" > - Secret Key{origin.secretKey ? <>{' \u2705'} : <>} + {remote.name === 'azureblob' ? 'Access Key' : 'Secret Key'} + {remote.secretKey ? <>{' \u2705'} : <>}
@@ -118,14 +121,19 @@ const Remote = (props) => { id="accountId" name="accountId" onChange={(e) => { - dispatch(updateAccountId({accountId: e.target.value.trim(), remoteType})); + dispatch( + updateAccountId({ + accountId: e.target.value.trim(), + remoteType, + }) + ); }} >
)} diff --git a/client/components/RemoteContainer.js b/client/components/RemoteContainer.js index c015fe8..8a302fb 100644 --- a/client/components/RemoteContainer.js +++ b/client/components/RemoteContainer.js @@ -17,7 +17,6 @@ export const RemoteContainer = (props) => { remoteType={'origin'} accessIdHandler={accessIdHandler} secretKeyHandler={secretKeyHandler} - accountIdHandler={accountIdHandler} displayName={origin.displayName} > )} @@ -31,7 +30,6 @@ export const RemoteContainer = (props) => { remoteType={'destination'} accessIdHandler={accessIdHandler} secretKeyHandler={secretKeyHandler} - accountIdHandler={accountIdHandler} displayName={destination.displayName} /> )} @@ -48,7 +46,7 @@ const accessIdHandler = (e, remote) => { ); const isCloudflareAccessId = /^[a-z0-9]{32}$/.test(accessId); const isMicrosoftAccessId = - remote.name === 'azureblob' && !isAmazonAccessId && isCloudflareAccessId + remote.name === 'azureblob' && !isAmazonAccessId && !isCloudflareAccessId ? true : false; if (isAmazonAccessId || isCloudflareAccessId || isMicrosoftAccessId) {