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

list audio resources and added delete button to delete the resource #11

Merged
merged 1 commit into from
Oct 29, 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
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