Shell-model approach to nuclear reactions