Skip to content

Commit

Permalink
Merge pull request #11 from Bridgeconn/Issue3-part1
Browse files Browse the repository at this point in the history
list audio resources and added delete button to delete the resource
  • Loading branch information
vipinpaul authored Oct 29, 2024
2 parents 2b266b1 + a01e472 commit 8dffa4c
Show file tree
Hide file tree
Showing 7 changed files with 434 additions and 153 deletions.
6 changes: 3 additions & 3 deletions App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export type RootStackParamList = {
'Sign up': undefined;
CreateProject: undefined;
ReferencePage: undefined;
ProjectEditor: {projectId: string; projectName: string ,projectPath:string,referenceRes:string};
ProjectEditor: {projectId: string; projectName: string ,projectPath:string,referenceResource:string};
};

const Stack = createStackNavigator<RootStackParamList>();
Expand All @@ -41,11 +41,11 @@ export default function App() {
permission = isManagePermitted;
});
// request rights to manage
if (permission===false) {
// if (permission===false) {
requestManagePermission().then(isManagePermitted => {
console.log("Permission for file access granted",isManagePermitted);
});
}
// }
const checkAndCreateFolderAndFile = async () => {
const folderPath = `${RNFS.ExternalStorageDirectoryPath}/Download/OBTRecorderApp`;
const filePath = `${folderPath}/appInfo.json`;
Expand Down
12 changes: 6 additions & 6 deletions screens/HomeScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ const HomeScreen: React.FC<Props> = ({navigation}) => {
const appInfo = JSON.parse(fileContent);

if (appInfo.projects && Array.isArray(appInfo.projects)) {
const loadedProjects = appInfo.projects.map((project, index) => ({
const loadedProjects = appInfo.projects.map((project: { projectName: any; projectPath: any; referenceResource: any; }, index: number) => ({
id: `${index + 1}`,
name: project.projectName,
path: project.projectPath,
reference:project.ReferenceResource,
reference:project.referenceResource,
}));
setProjects(loadedProjects);
} else {
Expand All @@ -91,11 +91,11 @@ const HomeScreen: React.FC<Props> = ({navigation}) => {
const appInfo = JSON.parse(fileContent);

if (appInfo.projects && Array.isArray(appInfo.projects)) {
const loadedProjects = appInfo.projects.map((project, index) => ({
const loadedProjects = appInfo.projects.map((project: { projectName: any; projectPath: any; referenceResource: any; }, index: number) => ({
id: `${index + 1}`,
name: project.projectName,
path: project.projectPath,
reference: project.ReferenceResource
reference: project.referenceResource
}));
setProjects(loadedProjects);
} else {
Expand Down Expand Up @@ -162,7 +162,7 @@ const HomeScreen: React.FC<Props> = ({navigation}) => {
};

const navigateToProjectEditor = (id: string, name: string , path:string, reference:string) => {
navigation.navigate('ProjectEditor', {projectId: id, projectName: name, projectPath:path, referenceRes:reference});
navigation.navigate('ProjectEditor', {projectId: id, projectName: name, projectPath:path, referenceResource:reference});
};

const handleImport = async (folderPath: string) => {
Expand Down Expand Up @@ -363,7 +363,7 @@ const styles = StyleSheet.create({
borderBottomColor: '#ddd',
},
drawerStyle: {
// backgroundColor: '#000',
backgroundColor: '#2f3542',
position: 'absolute',
right: 0,
width: '45%',
Expand Down
2 changes: 1 addition & 1 deletion screens/ImportModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ const ImportModal: React.FC<ImportModalProps> = ({
<Text style={{color: '#000'}}>
Please wait. Importing Project in progress...
</Text>
<Text style={{color: '#26de81'}}>{convertingFileMessage}</Text>
<Text style={{color: '#ff7f50'}}>{convertingFileMessage}</Text>
</View>
) : selectedFolder ? (
<View>
Expand Down
Loading

0 comments on commit 8dffa4c

Please sign in to comment.