Skip to content

Commit

Permalink
1.0.50
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Lenczyk authored and Jan Lenczyk committed Aug 22, 2021
1 parent 1d4aa53 commit a612110
Show file tree
Hide file tree
Showing 9 changed files with 78 additions and 34 deletions.
5 changes: 1 addition & 4 deletions ios/App/App/capacitor.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,5 @@
"showSpinner": true
}
},
"cordova": {},
"server": {
"url": "http://192.168.178.20:8100"
}
"cordova": {}
}
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"@types/react-router-dom": "^5.1.3",
"@vitalets/google-translate-api": "^4.0.0",
"argon2": "^0.27.2",
"browser-image-compression": "https://github.com/FilenCloudDienste/browser-image-compression",
"boxicons": "^2.0.9",
"browser-image-compression": "git+https://github.com/FilenCloudDienste/browser-image-compression.git",
"cordova-plugin-file-opener2": "^3.0.5",
"cordova-plugin-navigationbar-color": "^0.1.0",
"crypto": "^1.0.1",
Expand All @@ -40,6 +41,7 @@
"rc-hammerjs": "^0.6.10",
"react": "^16.13.0",
"react-dom": "^16.13.0",
"react-icons": "^4.2.0",
"react-long": "^1.1.9",
"react-router": "^5.1.2",
"react-router-dom": "^5.1.2",
Expand Down
2 changes: 1 addition & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export default class App extends React.PureComponent<{}, AppStates> {
super(props)

this.state = {
mainToolbarTitle: "My Cloud",
mainToolbarTitle: language.get("en", "cloudDrives"),
itemList: [],
isLoggedIn: false,
userAPIKey: "",
Expand Down
6 changes: 4 additions & 2 deletions src/components/items.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,8 @@ export async function updateItemList(showLoader = true, bypassItemsCache = false
receiverEmail: "",
sharerId: 0,
sharerEmail: "",
color: null
color: null,
isBase: true
})

for(let i = 0; i < res.data.folders.length; i++){
Expand All @@ -229,7 +230,8 @@ export async function updateItemList(showLoader = true, bypassItemsCache = false
sharerId: 0,
sharerEmail: "",
color: folder.color || null,
favorited: folder.favorited
favorited: folder.favorited,
isBase: true
}

items.push(item)
Expand Down
53 changes: 39 additions & 14 deletions src/components/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import '../theme/variables.css';

import * as Ionicons from 'ionicons/icons';
import * as language from "../utils/language"
import { FaHdd } from "react-icons/fa"

import Hammer from "rc-hammerjs"
import { routeTo } from './router';
Expand Down Expand Up @@ -55,13 +56,25 @@ export function render(){
<img src="assets/images/folder.svg" style={{
display: "none"
}}></img>
<IonIcon icon={Ionicons.folderSharp} style={{
fontSize: "30pt",
color: utils.getFolderColorStyle(this.state.itemList[index].color, true),
position: "absolute",
marginTop: "6px",
marginLeft: "9px"
}}></IonIcon>
{
this.state.itemList[index].isBase ? (
<FaHdd style={{
fontSize: "30pt",
color: utils.getFolderColorStyle(this.state.itemList[index].color, true),
position: "absolute",
marginTop: "6px",
marginLeft: "9px"
}} />
) : (
<IonIcon icon={Ionicons.folderSharp} style={{
fontSize: "30pt",
color: utils.getFolderColorStyle(this.state.itemList[index].color, true),
position: "absolute",
marginTop: "6px",
marginLeft: "9px"
}}></IonIcon>
)
}
</div>
) : (
<img src={typeof this.state.itemList[index].thumbnail !== "undefined" ? this.state.itemList[index].thumbnail : utils.getFileIconFromName(this.state.itemList[index].name)} style={{
Expand All @@ -79,13 +92,25 @@ export function render(){
<img src="assets/images/folder.svg" style={{
display: "none"
}}></img>
<IonIcon icon={Ionicons.folderSharp} style={{
fontSize: "30pt",
color: utils.getFolderColorStyle(this.state.itemList[index].color, true),
position: "absolute",
marginTop: "6px",
marginLeft: "9px"
}}></IonIcon>
{
this.state.itemList[index].isBase ? (
<FaHdd style={{
fontSize: "30pt",
color: utils.getFolderColorStyle(this.state.itemList[index].color, true),
position: "absolute",
marginTop: "6px",
marginLeft: "9px"
}} />
) : (
<IonIcon icon={Ionicons.folderSharp} style={{
fontSize: "30pt",
color: utils.getFolderColorStyle(this.state.itemList[index].color, true),
position: "absolute",
marginTop: "6px",
marginLeft: "9px"
}}></IonIcon>
)
}
</div>
) : (
<img src={typeof this.state.itemList[index].thumbnail !== "undefined" ? this.state.itemList[index].thumbnail : utils.getFileIconFromName(this.state.itemList[index].name)} style={{
Expand Down
4 changes: 2 additions & 2 deletions src/components/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ export async function doSetup(){
if(getLang.value){
this.setState({
lang: getLang.value,
mainToolbarTitle: language.get(getLang.value, "myCloud")
mainToolbarTitle: language.get(getLang.value, "cloudDrives")
})

window.customVariables.lang = getLang.value
Expand All @@ -238,7 +238,7 @@ export async function doSetup(){

this.setState({
lang: defaultLang,
mainToolbarTitle: language.get(defaultLang, "myCloud")
mainToolbarTitle: language.get(defaultLang, "cloudDrives")
})

window.customVariables.lang = defaultLang
Expand Down
26 changes: 19 additions & 7 deletions src/components/spawn.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,20 +133,33 @@ export async function spawnRenamePrompt(item, callback){
}

export async function mainFabAction(){
let parent = utils.currentParentFolder()
let folderCreateBtnText = language.get(this.state.lang, "fabCreateFolder")
let folderCreateNewFolderNameText = language.get(this.state.lang, "newFolderName")
let folderCreatePlaceholderText = language.get(this.state.lang, "newFolderNamePlaceholder")
let folderCreateInvalidNameText = language.get(this.state.lang, "invalidFolderName")

if(parent == "base"){
folderCreateBtnText = language.get(this.state.lang, "fabCreateDrive")
folderCreateNewFolderNameText = language.get(this.state.lang, "newDriveName")
folderCreatePlaceholderText = language.get(this.state.lang, "newDriveNamePlaceholder")
folderCreateInvalidNameText = language.get(this.state.lang, "invalidDriveName")
}

let actionSheet = await actionSheetController.create({
buttons: [
{
text: language.get(this.state.lang, "fabCreateFolder"),
text: folderCreateBtnText,
icon: Ionicons.folderOpen,
handler: async () => {
let alert = await alertController.create({
header: language.get(this.state.lang, "newFolderName"),
header: folderCreateNewFolderNameText,
inputs: [
{
type: "text",
id: "new-folder-name-input",
name: "new-folder-name-input",
placeholder: language.get(this.state.lang, "newFolderNamePlaceholder")
placeholder: folderCreatePlaceholderText
}
],
buttons: [
Expand All @@ -166,7 +179,7 @@ export async function mainFabAction(){
name = utils.removeIllegalCharsFromString(name)

if(utils.checkIfNameIsBanned(name) || utils.folderNameRegex(name) || utils.fileNameValidationRegex(name)){
return this.spawnToast(language.get(this.state.lang, "invalidFolderName"))
return this.spawnToast(folderCreateInvalidNameText)
}

if(!name || typeof name !== "string"){
Expand All @@ -176,8 +189,7 @@ export async function mainFabAction(){
if(name.length <= 0){
return false
}

let parent = utils.currentParentFolder()

let folderParent = null
let folderUUID = utils.uuidv4()

Expand Down Expand Up @@ -264,7 +276,7 @@ export async function mainFabAction(){
else{
loading.dismiss()

this.spawnToast(language.get(this.state.lang, "folderCreated", true, ["__NAME__"], [name]))
this.spawnToast(language.get(this.state.lang, "driveCreated", true, ["__NAME__"], [name]))

clearTimeout(window.customVariables.reloadAfterActionTimeout)

Expand Down
6 changes: 3 additions & 3 deletions src/components/window.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export function windowRouter(){
}
else{
this.setState({
mainToolbarTitle: language.get(this.state.lang, "myCloud"),
mainToolbarTitle: language.get(this.state.lang, "cloudDrives"),
showMainToolbarBackButton: false
})
}
Expand Down Expand Up @@ -87,7 +87,7 @@ export function windowRouter(){
}
else{
this.setState({
mainToolbarTitle: language.get(this.state.lang, "myCloud"),
mainToolbarTitle: language.get(this.state.lang, "cloudDrives"),
showMainToolbarBackButton: false
})
}
Expand Down Expand Up @@ -146,7 +146,7 @@ export function setupWindowFunctions(){
window.customVariables.maxUploadThreads = 6
window.customVariables.maxDownloadThreads = 16
window.customVariables.currentDownloadThreads = 0
window.customVariables.maxWriteThreads = 64
window.customVariables.maxWriteThreads = 256
window.customVariables.currentWriteThreads = 0
window.customVariables.uploads = {}
window.customVariables.downloads = {}
Expand Down
6 changes: 6 additions & 0 deletions src/lang/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,12 @@ translations['en']['noFavorites'] = "No favorites found. You can mark files and
translations['en']['favorite'] = "Favorite"
translations['en']['unfavorite'] = "Unfavorite"
translations['en']['uploadStorageExceeded'] = "Could not upload __NAME__: Not enough storage."
translations['en']['cloudDrives'] = "Cloud Drives"
translations['en']['fabCreateDrive'] = "Create Drive"
translations['en']['newDriveName'] = "New Drive name"
translations['en']['newDriveNamePlaceholder'] = "Drive name"
translations['en']['invalidDriveName'] = "Invalid Drive name"
translations['en']['driveCreated'] = "Drive __NAME__ created"

module.exports = {
translations
Expand Down

0 comments on commit a612110

Please sign in to comment.